mirror of https://github.com/vernonkeenan/lib
parent
f9df7a0644
commit
a3036b3814
|
|
@ -34,13 +34,13 @@ type ClientOption func(*runtime.ClientOperation)
|
|||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
CreateAttendee(params *CreateAttendeeParams, opts ...ClientOption) (*CreateAttendeeCreated, error)
|
||||
CreateAttendee(params *CreateAttendeeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateAttendeeCreated, error)
|
||||
|
||||
DeleteAttendee(params *DeleteAttendeeParams, opts ...ClientOption) (*DeleteAttendeeNoContent, error)
|
||||
DeleteAttendee(params *DeleteAttendeeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAttendeeNoContent, error)
|
||||
|
||||
GetAttendees(params *GetAttendeesParams, opts ...ClientOption) (*GetAttendeesOK, error)
|
||||
GetAttendees(params *GetAttendeesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAttendeesOK, error)
|
||||
|
||||
UpdateAttendee(params *UpdateAttendeeParams, opts ...ClientOption) (*UpdateAttendeeOK, error)
|
||||
UpdateAttendee(params *UpdateAttendeeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateAttendeeOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
|
@ -48,7 +48,7 @@ type ClientService interface {
|
|||
/*
|
||||
CreateAttendee creates a new attendee
|
||||
*/
|
||||
func (a *Client) CreateAttendee(params *CreateAttendeeParams, opts ...ClientOption) (*CreateAttendeeCreated, error) {
|
||||
func (a *Client) CreateAttendee(params *CreateAttendeeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateAttendeeCreated, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewCreateAttendeeParams()
|
||||
|
|
@ -62,6 +62,7 @@ func (a *Client) CreateAttendee(params *CreateAttendeeParams, opts ...ClientOpti
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &CreateAttendeeReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
@ -86,7 +87,7 @@ func (a *Client) CreateAttendee(params *CreateAttendeeParams, opts ...ClientOpti
|
|||
/*
|
||||
DeleteAttendee deletes a attendee
|
||||
*/
|
||||
func (a *Client) DeleteAttendee(params *DeleteAttendeeParams, opts ...ClientOption) (*DeleteAttendeeNoContent, error) {
|
||||
func (a *Client) DeleteAttendee(params *DeleteAttendeeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAttendeeNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteAttendeeParams()
|
||||
|
|
@ -100,6 +101,7 @@ func (a *Client) DeleteAttendee(params *DeleteAttendeeParams, opts ...ClientOpti
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteAttendeeReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
@ -124,7 +126,7 @@ func (a *Client) DeleteAttendee(params *DeleteAttendeeParams, opts ...ClientOpti
|
|||
/*
|
||||
GetAttendees gets a list of attendees
|
||||
*/
|
||||
func (a *Client) GetAttendees(params *GetAttendeesParams, opts ...ClientOption) (*GetAttendeesOK, error) {
|
||||
func (a *Client) GetAttendees(params *GetAttendeesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAttendeesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAttendeesParams()
|
||||
|
|
@ -138,6 +140,7 @@ func (a *Client) GetAttendees(params *GetAttendeesParams, opts ...ClientOption)
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetAttendeesReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
@ -162,7 +165,7 @@ func (a *Client) GetAttendees(params *GetAttendeesParams, opts ...ClientOption)
|
|||
/*
|
||||
UpdateAttendee updates an existing attendee
|
||||
*/
|
||||
func (a *Client) UpdateAttendee(params *UpdateAttendeeParams, opts ...ClientOption) (*UpdateAttendeeOK, error) {
|
||||
func (a *Client) UpdateAttendee(params *UpdateAttendeeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateAttendeeOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewUpdateAttendeeParams()
|
||||
|
|
@ -176,6 +179,7 @@ func (a *Client) UpdateAttendee(params *UpdateAttendeeParams, opts ...ClientOpti
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &UpdateAttendeeReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,13 +34,13 @@ type ClientOption func(*runtime.ClientOperation)
|
|||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
CreateCertificate(params *CreateCertificateParams, opts ...ClientOption) (*CreateCertificateCreated, error)
|
||||
CreateCertificate(params *CreateCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCertificateCreated, error)
|
||||
|
||||
DeleteCertificate(params *DeleteCertificateParams, opts ...ClientOption) (*DeleteCertificateNoContent, error)
|
||||
DeleteCertificate(params *DeleteCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCertificateNoContent, error)
|
||||
|
||||
GetCertificates(params *GetCertificatesParams, opts ...ClientOption) (*GetCertificatesOK, error)
|
||||
GetCertificates(params *GetCertificatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCertificatesOK, error)
|
||||
|
||||
UpdateCertificate(params *UpdateCertificateParams, opts ...ClientOption) (*UpdateCertificateOK, error)
|
||||
UpdateCertificate(params *UpdateCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCertificateOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
|
@ -48,7 +48,7 @@ type ClientService interface {
|
|||
/*
|
||||
CreateCertificate creates a new certificate
|
||||
*/
|
||||
func (a *Client) CreateCertificate(params *CreateCertificateParams, opts ...ClientOption) (*CreateCertificateCreated, error) {
|
||||
func (a *Client) CreateCertificate(params *CreateCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCertificateCreated, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewCreateCertificateParams()
|
||||
|
|
@ -62,6 +62,7 @@ func (a *Client) CreateCertificate(params *CreateCertificateParams, opts ...Clie
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &CreateCertificateReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
@ -86,7 +87,7 @@ func (a *Client) CreateCertificate(params *CreateCertificateParams, opts ...Clie
|
|||
/*
|
||||
DeleteCertificate deletes a certificate
|
||||
*/
|
||||
func (a *Client) DeleteCertificate(params *DeleteCertificateParams, opts ...ClientOption) (*DeleteCertificateNoContent, error) {
|
||||
func (a *Client) DeleteCertificate(params *DeleteCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCertificateNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteCertificateParams()
|
||||
|
|
@ -100,6 +101,7 @@ func (a *Client) DeleteCertificate(params *DeleteCertificateParams, opts ...Clie
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteCertificateReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
@ -124,7 +126,7 @@ func (a *Client) DeleteCertificate(params *DeleteCertificateParams, opts ...Clie
|
|||
/*
|
||||
GetCertificates gets a list of certificates
|
||||
*/
|
||||
func (a *Client) GetCertificates(params *GetCertificatesParams, opts ...ClientOption) (*GetCertificatesOK, error) {
|
||||
func (a *Client) GetCertificates(params *GetCertificatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCertificatesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetCertificatesParams()
|
||||
|
|
@ -138,6 +140,7 @@ func (a *Client) GetCertificates(params *GetCertificatesParams, opts ...ClientOp
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetCertificatesReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
@ -162,7 +165,7 @@ func (a *Client) GetCertificates(params *GetCertificatesParams, opts ...ClientOp
|
|||
/*
|
||||
UpdateCertificate updates an existing certificate
|
||||
*/
|
||||
func (a *Client) UpdateCertificate(params *UpdateCertificateParams, opts ...ClientOption) (*UpdateCertificateOK, error) {
|
||||
func (a *Client) UpdateCertificate(params *UpdateCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCertificateOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewUpdateCertificateParams()
|
||||
|
|
@ -176,6 +179,7 @@ func (a *Client) UpdateCertificate(params *UpdateCertificateParams, opts ...Clie
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &UpdateCertificateReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -292,8 +292,6 @@ GetClustersNotFound describes a response with status code 404, with default head
|
|||
Resource was not found
|
||||
*/
|
||||
type GetClustersNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
|
|
@ -341,13 +339,6 @@ func (o *GetClustersNotFound) GetPayload() *members_models.Error {
|
|||
|
||||
func (o *GetClustersNotFound) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
|
|
@ -437,8 +428,6 @@ GetClustersInternalServerError describes a response with status code 500, with d
|
|||
Server Internal Error
|
||||
*/
|
||||
type GetClustersInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
|
|
@ -486,13 +475,6 @@ func (o *GetClustersInternalServerError) GetPayload() *members_models.Error {
|
|||
|
||||
func (o *GetClustersInternalServerError) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
|
|
|
|||
|
|
@ -292,8 +292,6 @@ PostClustersNotFound describes a response with status code 404, with default hea
|
|||
Resource was not found
|
||||
*/
|
||||
type PostClustersNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
|
|
@ -341,13 +339,6 @@ func (o *PostClustersNotFound) GetPayload() *members_models.Error {
|
|||
|
||||
func (o *PostClustersNotFound) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
|
|
@ -437,8 +428,6 @@ PostClustersInternalServerError describes a response with status code 500, with
|
|||
Server Internal Error
|
||||
*/
|
||||
type PostClustersInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
|
|
@ -486,13 +475,6 @@ func (o *PostClustersInternalServerError) GetPayload() *members_models.Error {
|
|||
|
||||
func (o *PostClustersInternalServerError) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
|
|
|
|||
|
|
@ -292,8 +292,6 @@ PutClustersNotFound describes a response with status code 404, with default head
|
|||
Resource was not found
|
||||
*/
|
||||
type PutClustersNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
|
|
@ -341,13 +339,6 @@ func (o *PutClustersNotFound) GetPayload() *members_models.Error {
|
|||
|
||||
func (o *PutClustersNotFound) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
|
|
@ -437,8 +428,6 @@ PutClustersInternalServerError describes a response with status code 500, with d
|
|||
Server Internal Error
|
||||
*/
|
||||
type PutClustersInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
|
|
@ -486,13 +475,6 @@ func (o *PutClustersInternalServerError) GetPayload() *members_models.Error {
|
|||
|
||||
func (o *PutClustersInternalServerError) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
|
|
|
|||
|
|
@ -1,203 +0,0 @@
|
|||
// 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 course_lessons
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// New creates a new course lessons API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for course lessons API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientOption is the option for Client methods
|
||||
type ClientOption func(*runtime.ClientOperation)
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
CreateCourseLesson(params *CreateCourseLessonParams, opts ...ClientOption) (*CreateCourseLessonCreated, error)
|
||||
|
||||
DeleteCourseLesson(params *DeleteCourseLessonParams, opts ...ClientOption) (*DeleteCourseLessonNoContent, error)
|
||||
|
||||
GetCourseLessons(params *GetCourseLessonsParams, opts ...ClientOption) (*GetCourseLessonsOK, error)
|
||||
|
||||
UpdateCourseLesson(params *UpdateCourseLessonParams, opts ...ClientOption) (*UpdateCourseLessonOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
CreateCourseLesson creates a new course lesson
|
||||
*/
|
||||
func (a *Client) CreateCourseLesson(params *CreateCourseLessonParams, opts ...ClientOption) (*CreateCourseLessonCreated, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewCreateCourseLessonParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "createCourseLesson",
|
||||
Method: "POST",
|
||||
PathPattern: "/courselessons",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &CreateCourseLessonReader{formats: a.formats},
|
||||
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.(*CreateCourseLessonCreated)
|
||||
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 createCourseLesson: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteCourseLesson deletes a course lesson
|
||||
*/
|
||||
func (a *Client) DeleteCourseLesson(params *DeleteCourseLessonParams, opts ...ClientOption) (*DeleteCourseLessonNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteCourseLessonParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "deleteCourseLesson",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/courselessons",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteCourseLessonReader{formats: a.formats},
|
||||
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.(*DeleteCourseLessonNoContent)
|
||||
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 deleteCourseLesson: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetCourseLessons gets a list of course lessons
|
||||
*/
|
||||
func (a *Client) GetCourseLessons(params *GetCourseLessonsParams, opts ...ClientOption) (*GetCourseLessonsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetCourseLessonsParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getCourseLessons",
|
||||
Method: "GET",
|
||||
PathPattern: "/courselessons",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetCourseLessonsReader{formats: a.formats},
|
||||
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.(*GetCourseLessonsOK)
|
||||
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 getCourseLessons: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourseLesson updates an existing course lesson
|
||||
*/
|
||||
func (a *Client) UpdateCourseLesson(params *UpdateCourseLessonParams, opts ...ClientOption) (*UpdateCourseLessonOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewUpdateCourseLessonParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "updateCourseLesson",
|
||||
Method: "PUT",
|
||||
PathPattern: "/courselessons",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &UpdateCourseLessonReader{formats: a.formats},
|
||||
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.(*UpdateCourseLessonOK)
|
||||
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 updateCourseLesson: 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
|
||||
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
||||
a.transport = transport
|
||||
}
|
||||
|
|
@ -1,157 +0,0 @@
|
|||
// 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 course_lessons
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewCreateCourseLessonParams creates a new CreateCourseLessonParams 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 NewCreateCourseLessonParams() *CreateCourseLessonParams {
|
||||
return &CreateCourseLessonParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateCourseLessonParamsWithTimeout creates a new CreateCourseLessonParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewCreateCourseLessonParamsWithTimeout(timeout time.Duration) *CreateCourseLessonParams {
|
||||
return &CreateCourseLessonParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateCourseLessonParamsWithContext creates a new CreateCourseLessonParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewCreateCourseLessonParamsWithContext(ctx context.Context) *CreateCourseLessonParams {
|
||||
return &CreateCourseLessonParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateCourseLessonParamsWithHTTPClient creates a new CreateCourseLessonParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewCreateCourseLessonParamsWithHTTPClient(client *http.Client) *CreateCourseLessonParams {
|
||||
return &CreateCourseLessonParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateCourseLessonParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the create course lesson operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type CreateCourseLessonParams struct {
|
||||
|
||||
/* CourselessonRequest.
|
||||
|
||||
An array of new CourseLesson records
|
||||
*/
|
||||
CourselessonRequest *members_models.CourseLessonRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the create course lesson params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *CreateCourseLessonParams) WithDefaults() *CreateCourseLessonParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the create course lesson params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *CreateCourseLessonParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the create course lesson params
|
||||
func (o *CreateCourseLessonParams) WithTimeout(timeout time.Duration) *CreateCourseLessonParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the create course lesson params
|
||||
func (o *CreateCourseLessonParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the create course lesson params
|
||||
func (o *CreateCourseLessonParams) WithContext(ctx context.Context) *CreateCourseLessonParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the create course lesson params
|
||||
func (o *CreateCourseLessonParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the create course lesson params
|
||||
func (o *CreateCourseLessonParams) WithHTTPClient(client *http.Client) *CreateCourseLessonParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the create course lesson params
|
||||
func (o *CreateCourseLessonParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithCourselessonRequest adds the courselessonRequest to the create course lesson params
|
||||
func (o *CreateCourseLessonParams) WithCourselessonRequest(courselessonRequest *members_models.CourseLessonRequest) *CreateCourseLessonParams {
|
||||
o.SetCourselessonRequest(courselessonRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetCourselessonRequest adds the courselessonRequest to the create course lesson params
|
||||
func (o *CreateCourseLessonParams) SetCourselessonRequest(courselessonRequest *members_models.CourseLessonRequest) {
|
||||
o.CourselessonRequest = courselessonRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *CreateCourseLessonParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.CourselessonRequest != nil {
|
||||
if err := r.SetBodyParam(o.CourselessonRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 course_lessons
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// CreateCourseLessonReader is a Reader for the CreateCourseLesson structure.
|
||||
type CreateCourseLessonReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *CreateCourseLessonReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 201:
|
||||
result := NewCreateCourseLessonCreated()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateCourseLessonCreated creates a CreateCourseLessonCreated with default headers values
|
||||
func NewCreateCourseLessonCreated() *CreateCourseLessonCreated {
|
||||
return &CreateCourseLessonCreated{}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateCourseLessonCreated describes a response with status code 201, with default header values.
|
||||
|
||||
Created
|
||||
*/
|
||||
type CreateCourseLessonCreated struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this create course lesson created response has a 2xx status code
|
||||
func (o *CreateCourseLessonCreated) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this create course lesson created response has a 3xx status code
|
||||
func (o *CreateCourseLessonCreated) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this create course lesson created response has a 4xx status code
|
||||
func (o *CreateCourseLessonCreated) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this create course lesson created response has a 5xx status code
|
||||
func (o *CreateCourseLessonCreated) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this create course lesson created response a status code equal to that given
|
||||
func (o *CreateCourseLessonCreated) IsCode(code int) bool {
|
||||
return code == 201
|
||||
}
|
||||
|
||||
// Code gets the status code for the create course lesson created response
|
||||
func (o *CreateCourseLessonCreated) Code() int {
|
||||
return 201
|
||||
}
|
||||
|
||||
func (o *CreateCourseLessonCreated) Error() string {
|
||||
return fmt.Sprintf("[POST /courselessons][%d] createCourseLessonCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *CreateCourseLessonCreated) String() string {
|
||||
return fmt.Sprintf("[POST /courselessons][%d] createCourseLessonCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *CreateCourseLessonCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,167 +0,0 @@
|
|||
// 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 course_lessons
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewDeleteCourseLessonParams creates a new DeleteCourseLessonParams 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 NewDeleteCourseLessonParams() *DeleteCourseLessonParams {
|
||||
return &DeleteCourseLessonParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteCourseLessonParamsWithTimeout creates a new DeleteCourseLessonParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewDeleteCourseLessonParamsWithTimeout(timeout time.Duration) *DeleteCourseLessonParams {
|
||||
return &DeleteCourseLessonParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteCourseLessonParamsWithContext creates a new DeleteCourseLessonParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewDeleteCourseLessonParamsWithContext(ctx context.Context) *DeleteCourseLessonParams {
|
||||
return &DeleteCourseLessonParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteCourseLessonParamsWithHTTPClient creates a new DeleteCourseLessonParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewDeleteCourseLessonParamsWithHTTPClient(client *http.Client) *DeleteCourseLessonParams {
|
||||
return &DeleteCourseLessonParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteCourseLessonParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the delete course lesson operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type DeleteCourseLessonParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Unique Record ID
|
||||
*/
|
||||
ID *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the delete course lesson params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteCourseLessonParams) WithDefaults() *DeleteCourseLessonParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the delete course lesson params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteCourseLessonParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete course lesson params
|
||||
func (o *DeleteCourseLessonParams) WithTimeout(timeout time.Duration) *DeleteCourseLessonParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete course lesson params
|
||||
func (o *DeleteCourseLessonParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete course lesson params
|
||||
func (o *DeleteCourseLessonParams) WithContext(ctx context.Context) *DeleteCourseLessonParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete course lesson params
|
||||
func (o *DeleteCourseLessonParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete course lesson params
|
||||
func (o *DeleteCourseLessonParams) WithHTTPClient(client *http.Client) *DeleteCourseLessonParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete course lesson params
|
||||
func (o *DeleteCourseLessonParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the delete course lesson params
|
||||
func (o *DeleteCourseLessonParams) WithID(id *string) *DeleteCourseLessonParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the delete course lesson params
|
||||
func (o *DeleteCourseLessonParams) SetID(id *string) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *DeleteCourseLessonParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.ID != nil {
|
||||
|
||||
// query param id
|
||||
var qrID string
|
||||
|
||||
if o.ID != nil {
|
||||
qrID = *o.ID
|
||||
}
|
||||
qID := qrID
|
||||
if qID != "" {
|
||||
|
||||
if err := r.SetQueryParam("id", qID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 course_lessons
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// DeleteCourseLessonReader is a Reader for the DeleteCourseLesson structure.
|
||||
type DeleteCourseLessonReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteCourseLessonReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 204:
|
||||
result := NewDeleteCourseLessonNoContent()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteCourseLessonNoContent creates a DeleteCourseLessonNoContent with default headers values
|
||||
func NewDeleteCourseLessonNoContent() *DeleteCourseLessonNoContent {
|
||||
return &DeleteCourseLessonNoContent{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteCourseLessonNoContent describes a response with status code 204, with default header values.
|
||||
|
||||
No Content
|
||||
*/
|
||||
type DeleteCourseLessonNoContent struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this delete course lesson no content response has a 2xx status code
|
||||
func (o *DeleteCourseLessonNoContent) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this delete course lesson no content response has a 3xx status code
|
||||
func (o *DeleteCourseLessonNoContent) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this delete course lesson no content response has a 4xx status code
|
||||
func (o *DeleteCourseLessonNoContent) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this delete course lesson no content response has a 5xx status code
|
||||
func (o *DeleteCourseLessonNoContent) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this delete course lesson no content response a status code equal to that given
|
||||
func (o *DeleteCourseLessonNoContent) IsCode(code int) bool {
|
||||
return code == 204
|
||||
}
|
||||
|
||||
// Code gets the status code for the delete course lesson no content response
|
||||
func (o *DeleteCourseLessonNoContent) Code() int {
|
||||
return 204
|
||||
}
|
||||
|
||||
func (o *DeleteCourseLessonNoContent) Error() string {
|
||||
return fmt.Sprintf("[DELETE /courselessons][%d] deleteCourseLessonNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *DeleteCourseLessonNoContent) String() string {
|
||||
return fmt.Sprintf("[DELETE /courselessons][%d] deleteCourseLessonNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *DeleteCourseLessonNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 course_lessons
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// GetCourseLessonsReader is a Reader for the GetCourseLessons structure.
|
||||
type GetCourseLessonsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetCourseLessonsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetCourseLessonsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetCourseLessonsOK creates a GetCourseLessonsOK with default headers values
|
||||
func NewGetCourseLessonsOK() *GetCourseLessonsOK {
|
||||
return &GetCourseLessonsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCourseLessonsOK describes a response with status code 200, with default header values.
|
||||
|
||||
OK
|
||||
*/
|
||||
type GetCourseLessonsOK struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get course lessons o k response has a 2xx status code
|
||||
func (o *GetCourseLessonsOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get course lessons o k response has a 3xx status code
|
||||
func (o *GetCourseLessonsOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get course lessons o k response has a 4xx status code
|
||||
func (o *GetCourseLessonsOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get course lessons o k response has a 5xx status code
|
||||
func (o *GetCourseLessonsOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get course lessons o k response a status code equal to that given
|
||||
func (o *GetCourseLessonsOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the get course lessons o k response
|
||||
func (o *GetCourseLessonsOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /courselessons][%d] getCourseLessonsOK ", 200)
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsOK) String() string {
|
||||
return fmt.Sprintf("[GET /courselessons][%d] getCourseLessonsOK ", 200)
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 course_lessons
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// UpdateCourseLessonReader is a Reader for the UpdateCourseLesson structure.
|
||||
type UpdateCourseLessonReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *UpdateCourseLessonReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewUpdateCourseLessonOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateCourseLessonOK creates a UpdateCourseLessonOK with default headers values
|
||||
func NewUpdateCourseLessonOK() *UpdateCourseLessonOK {
|
||||
return &UpdateCourseLessonOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourseLessonOK describes a response with status code 200, with default header values.
|
||||
|
||||
OK
|
||||
*/
|
||||
type UpdateCourseLessonOK struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update course lesson o k response has a 2xx status code
|
||||
func (o *UpdateCourseLessonOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update course lesson o k response has a 3xx status code
|
||||
func (o *UpdateCourseLessonOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update course lesson o k response has a 4xx status code
|
||||
func (o *UpdateCourseLessonOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update course lesson o k response has a 5xx status code
|
||||
func (o *UpdateCourseLessonOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update course lesson o k response a status code equal to that given
|
||||
func (o *UpdateCourseLessonOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the update course lesson o k response
|
||||
func (o *UpdateCourseLessonOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonOK ", 200)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonOK) String() string {
|
||||
return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonOK ", 200)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,203 +0,0 @@
|
|||
// 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 course_sections
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// New creates a new course sections API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for course sections API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientOption is the option for Client methods
|
||||
type ClientOption func(*runtime.ClientOperation)
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
CreateCourseSection(params *CreateCourseSectionParams, opts ...ClientOption) (*CreateCourseSectionCreated, error)
|
||||
|
||||
DeleteCourseSection(params *DeleteCourseSectionParams, opts ...ClientOption) (*DeleteCourseSectionNoContent, error)
|
||||
|
||||
GetCourseSections(params *GetCourseSectionsParams, opts ...ClientOption) (*GetCourseSectionsOK, error)
|
||||
|
||||
UpdateCourseSection(params *UpdateCourseSectionParams, opts ...ClientOption) (*UpdateCourseSectionOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
CreateCourseSection creates a new course section
|
||||
*/
|
||||
func (a *Client) CreateCourseSection(params *CreateCourseSectionParams, opts ...ClientOption) (*CreateCourseSectionCreated, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewCreateCourseSectionParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "createCourseSection",
|
||||
Method: "POST",
|
||||
PathPattern: "/coursesections",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &CreateCourseSectionReader{formats: a.formats},
|
||||
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.(*CreateCourseSectionCreated)
|
||||
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 createCourseSection: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteCourseSection deletes a course section
|
||||
*/
|
||||
func (a *Client) DeleteCourseSection(params *DeleteCourseSectionParams, opts ...ClientOption) (*DeleteCourseSectionNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteCourseSectionParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "deleteCourseSection",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/coursesections",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteCourseSectionReader{formats: a.formats},
|
||||
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.(*DeleteCourseSectionNoContent)
|
||||
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 deleteCourseSection: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetCourseSections gets a list of course sections
|
||||
*/
|
||||
func (a *Client) GetCourseSections(params *GetCourseSectionsParams, opts ...ClientOption) (*GetCourseSectionsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetCourseSectionsParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getCourseSections",
|
||||
Method: "GET",
|
||||
PathPattern: "/coursesections",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetCourseSectionsReader{formats: a.formats},
|
||||
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.(*GetCourseSectionsOK)
|
||||
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 getCourseSections: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourseSection updates an existing course section
|
||||
*/
|
||||
func (a *Client) UpdateCourseSection(params *UpdateCourseSectionParams, opts ...ClientOption) (*UpdateCourseSectionOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewUpdateCourseSectionParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "updateCourseSection",
|
||||
Method: "PUT",
|
||||
PathPattern: "/coursesections",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &UpdateCourseSectionReader{formats: a.formats},
|
||||
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.(*UpdateCourseSectionOK)
|
||||
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 updateCourseSection: 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
|
||||
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
||||
a.transport = transport
|
||||
}
|
||||
|
|
@ -1,157 +0,0 @@
|
|||
// 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 course_sections
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewCreateCourseSectionParams creates a new CreateCourseSectionParams 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 NewCreateCourseSectionParams() *CreateCourseSectionParams {
|
||||
return &CreateCourseSectionParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateCourseSectionParamsWithTimeout creates a new CreateCourseSectionParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewCreateCourseSectionParamsWithTimeout(timeout time.Duration) *CreateCourseSectionParams {
|
||||
return &CreateCourseSectionParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateCourseSectionParamsWithContext creates a new CreateCourseSectionParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewCreateCourseSectionParamsWithContext(ctx context.Context) *CreateCourseSectionParams {
|
||||
return &CreateCourseSectionParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateCourseSectionParamsWithHTTPClient creates a new CreateCourseSectionParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewCreateCourseSectionParamsWithHTTPClient(client *http.Client) *CreateCourseSectionParams {
|
||||
return &CreateCourseSectionParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateCourseSectionParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the create course section operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type CreateCourseSectionParams struct {
|
||||
|
||||
/* CoursesectionRequest.
|
||||
|
||||
An array of new CourseSection records
|
||||
*/
|
||||
CoursesectionRequest *members_models.CourseSectionRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the create course section params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *CreateCourseSectionParams) WithDefaults() *CreateCourseSectionParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the create course section params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *CreateCourseSectionParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the create course section params
|
||||
func (o *CreateCourseSectionParams) WithTimeout(timeout time.Duration) *CreateCourseSectionParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the create course section params
|
||||
func (o *CreateCourseSectionParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the create course section params
|
||||
func (o *CreateCourseSectionParams) WithContext(ctx context.Context) *CreateCourseSectionParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the create course section params
|
||||
func (o *CreateCourseSectionParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the create course section params
|
||||
func (o *CreateCourseSectionParams) WithHTTPClient(client *http.Client) *CreateCourseSectionParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the create course section params
|
||||
func (o *CreateCourseSectionParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithCoursesectionRequest adds the coursesectionRequest to the create course section params
|
||||
func (o *CreateCourseSectionParams) WithCoursesectionRequest(coursesectionRequest *members_models.CourseSectionRequest) *CreateCourseSectionParams {
|
||||
o.SetCoursesectionRequest(coursesectionRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetCoursesectionRequest adds the coursesectionRequest to the create course section params
|
||||
func (o *CreateCourseSectionParams) SetCoursesectionRequest(coursesectionRequest *members_models.CourseSectionRequest) {
|
||||
o.CoursesectionRequest = coursesectionRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *CreateCourseSectionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.CoursesectionRequest != nil {
|
||||
if err := r.SetBodyParam(o.CoursesectionRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 course_sections
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// CreateCourseSectionReader is a Reader for the CreateCourseSection structure.
|
||||
type CreateCourseSectionReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *CreateCourseSectionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 201:
|
||||
result := NewCreateCourseSectionCreated()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateCourseSectionCreated creates a CreateCourseSectionCreated with default headers values
|
||||
func NewCreateCourseSectionCreated() *CreateCourseSectionCreated {
|
||||
return &CreateCourseSectionCreated{}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateCourseSectionCreated describes a response with status code 201, with default header values.
|
||||
|
||||
Created
|
||||
*/
|
||||
type CreateCourseSectionCreated struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this create course section created response has a 2xx status code
|
||||
func (o *CreateCourseSectionCreated) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this create course section created response has a 3xx status code
|
||||
func (o *CreateCourseSectionCreated) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this create course section created response has a 4xx status code
|
||||
func (o *CreateCourseSectionCreated) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this create course section created response has a 5xx status code
|
||||
func (o *CreateCourseSectionCreated) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this create course section created response a status code equal to that given
|
||||
func (o *CreateCourseSectionCreated) IsCode(code int) bool {
|
||||
return code == 201
|
||||
}
|
||||
|
||||
// Code gets the status code for the create course section created response
|
||||
func (o *CreateCourseSectionCreated) Code() int {
|
||||
return 201
|
||||
}
|
||||
|
||||
func (o *CreateCourseSectionCreated) Error() string {
|
||||
return fmt.Sprintf("[POST /coursesections][%d] createCourseSectionCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *CreateCourseSectionCreated) String() string {
|
||||
return fmt.Sprintf("[POST /coursesections][%d] createCourseSectionCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *CreateCourseSectionCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,167 +0,0 @@
|
|||
// 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 course_sections
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewDeleteCourseSectionParams creates a new DeleteCourseSectionParams 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 NewDeleteCourseSectionParams() *DeleteCourseSectionParams {
|
||||
return &DeleteCourseSectionParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteCourseSectionParamsWithTimeout creates a new DeleteCourseSectionParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewDeleteCourseSectionParamsWithTimeout(timeout time.Duration) *DeleteCourseSectionParams {
|
||||
return &DeleteCourseSectionParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteCourseSectionParamsWithContext creates a new DeleteCourseSectionParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewDeleteCourseSectionParamsWithContext(ctx context.Context) *DeleteCourseSectionParams {
|
||||
return &DeleteCourseSectionParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteCourseSectionParamsWithHTTPClient creates a new DeleteCourseSectionParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewDeleteCourseSectionParamsWithHTTPClient(client *http.Client) *DeleteCourseSectionParams {
|
||||
return &DeleteCourseSectionParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteCourseSectionParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the delete course section operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type DeleteCourseSectionParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Unique Record ID
|
||||
*/
|
||||
ID *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the delete course section params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteCourseSectionParams) WithDefaults() *DeleteCourseSectionParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the delete course section params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteCourseSectionParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete course section params
|
||||
func (o *DeleteCourseSectionParams) WithTimeout(timeout time.Duration) *DeleteCourseSectionParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete course section params
|
||||
func (o *DeleteCourseSectionParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete course section params
|
||||
func (o *DeleteCourseSectionParams) WithContext(ctx context.Context) *DeleteCourseSectionParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete course section params
|
||||
func (o *DeleteCourseSectionParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete course section params
|
||||
func (o *DeleteCourseSectionParams) WithHTTPClient(client *http.Client) *DeleteCourseSectionParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete course section params
|
||||
func (o *DeleteCourseSectionParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the delete course section params
|
||||
func (o *DeleteCourseSectionParams) WithID(id *string) *DeleteCourseSectionParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the delete course section params
|
||||
func (o *DeleteCourseSectionParams) SetID(id *string) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *DeleteCourseSectionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.ID != nil {
|
||||
|
||||
// query param id
|
||||
var qrID string
|
||||
|
||||
if o.ID != nil {
|
||||
qrID = *o.ID
|
||||
}
|
||||
qID := qrID
|
||||
if qID != "" {
|
||||
|
||||
if err := r.SetQueryParam("id", qID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 course_sections
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// DeleteCourseSectionReader is a Reader for the DeleteCourseSection structure.
|
||||
type DeleteCourseSectionReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteCourseSectionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 204:
|
||||
result := NewDeleteCourseSectionNoContent()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteCourseSectionNoContent creates a DeleteCourseSectionNoContent with default headers values
|
||||
func NewDeleteCourseSectionNoContent() *DeleteCourseSectionNoContent {
|
||||
return &DeleteCourseSectionNoContent{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteCourseSectionNoContent describes a response with status code 204, with default header values.
|
||||
|
||||
No Content
|
||||
*/
|
||||
type DeleteCourseSectionNoContent struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this delete course section no content response has a 2xx status code
|
||||
func (o *DeleteCourseSectionNoContent) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this delete course section no content response has a 3xx status code
|
||||
func (o *DeleteCourseSectionNoContent) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this delete course section no content response has a 4xx status code
|
||||
func (o *DeleteCourseSectionNoContent) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this delete course section no content response has a 5xx status code
|
||||
func (o *DeleteCourseSectionNoContent) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this delete course section no content response a status code equal to that given
|
||||
func (o *DeleteCourseSectionNoContent) IsCode(code int) bool {
|
||||
return code == 204
|
||||
}
|
||||
|
||||
// Code gets the status code for the delete course section no content response
|
||||
func (o *DeleteCourseSectionNoContent) Code() int {
|
||||
return 204
|
||||
}
|
||||
|
||||
func (o *DeleteCourseSectionNoContent) Error() string {
|
||||
return fmt.Sprintf("[DELETE /coursesections][%d] deleteCourseSectionNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *DeleteCourseSectionNoContent) String() string {
|
||||
return fmt.Sprintf("[DELETE /coursesections][%d] deleteCourseSectionNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *DeleteCourseSectionNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 course_sections
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// GetCourseSectionsReader is a Reader for the GetCourseSections structure.
|
||||
type GetCourseSectionsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetCourseSectionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetCourseSectionsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetCourseSectionsOK creates a GetCourseSectionsOK with default headers values
|
||||
func NewGetCourseSectionsOK() *GetCourseSectionsOK {
|
||||
return &GetCourseSectionsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCourseSectionsOK describes a response with status code 200, with default header values.
|
||||
|
||||
OK
|
||||
*/
|
||||
type GetCourseSectionsOK struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get course sections o k response has a 2xx status code
|
||||
func (o *GetCourseSectionsOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get course sections o k response has a 3xx status code
|
||||
func (o *GetCourseSectionsOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get course sections o k response has a 4xx status code
|
||||
func (o *GetCourseSectionsOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get course sections o k response has a 5xx status code
|
||||
func (o *GetCourseSectionsOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get course sections o k response a status code equal to that given
|
||||
func (o *GetCourseSectionsOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the get course sections o k response
|
||||
func (o *GetCourseSectionsOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsOK ", 200)
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsOK) String() string {
|
||||
return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsOK ", 200)
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 course_sections
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// UpdateCourseSectionReader is a Reader for the UpdateCourseSection structure.
|
||||
type UpdateCourseSectionReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *UpdateCourseSectionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewUpdateCourseSectionOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateCourseSectionOK creates a UpdateCourseSectionOK with default headers values
|
||||
func NewUpdateCourseSectionOK() *UpdateCourseSectionOK {
|
||||
return &UpdateCourseSectionOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourseSectionOK describes a response with status code 200, with default header values.
|
||||
|
||||
OK
|
||||
*/
|
||||
type UpdateCourseSectionOK struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update course section o k response has a 2xx status code
|
||||
func (o *UpdateCourseSectionOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update course section o k response has a 3xx status code
|
||||
func (o *UpdateCourseSectionOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update course section o k response has a 4xx status code
|
||||
func (o *UpdateCourseSectionOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update course section o k response has a 5xx status code
|
||||
func (o *UpdateCourseSectionOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update course section o k response a status code equal to that given
|
||||
func (o *UpdateCourseSectionOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the update course section o k response
|
||||
func (o *UpdateCourseSectionOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /coursesections][%d] updateCourseSectionOK ", 200)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionOK) String() string {
|
||||
return fmt.Sprintf("[PUT /coursesections][%d] updateCourseSectionOK ", 200)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -34,34 +34,45 @@ type ClientOption func(*runtime.ClientOperation)
|
|||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
CreateCourse(params *CreateCourseParams, opts ...ClientOption) (*CreateCourseCreated, error)
|
||||
GetCourseLessons(params *GetCourseLessonsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCourseLessonsOK, error)
|
||||
|
||||
DeleteCourse(params *DeleteCourseParams, opts ...ClientOption) (*DeleteCourseNoContent, error)
|
||||
GetCourseSections(params *GetCourseSectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCourseSectionsOK, error)
|
||||
|
||||
GetCourses(params *GetCoursesParams, opts ...ClientOption) (*GetCoursesOK, error)
|
||||
GetCourses(params *GetCoursesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCoursesOK, error)
|
||||
|
||||
UpdateCourse(params *UpdateCourseParams, opts ...ClientOption) (*UpdateCourseOK, error)
|
||||
PostCourseLessons(params *PostCourseLessonsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostCourseLessonsOK, error)
|
||||
|
||||
PostCourseSections(params *PostCourseSectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostCourseSectionsOK, error)
|
||||
|
||||
PostCourses(params *PostCoursesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostCoursesOK, error)
|
||||
|
||||
UpdateCourseLessons(params *UpdateCourseLessonsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCourseLessonsOK, error)
|
||||
|
||||
UpdateCourseSections(params *UpdateCourseSectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCourseSectionsOK, error)
|
||||
|
||||
UpdateCourses(params *UpdateCoursesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCoursesOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
CreateCourse creates a new course
|
||||
GetCourseLessons gets a list of course lessons
|
||||
*/
|
||||
func (a *Client) CreateCourse(params *CreateCourseParams, opts ...ClientOption) (*CreateCourseCreated, error) {
|
||||
func (a *Client) GetCourseLessons(params *GetCourseLessonsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCourseLessonsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewCreateCourseParams()
|
||||
params = NewGetCourseLessonsParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "createCourse",
|
||||
Method: "POST",
|
||||
PathPattern: "/courses",
|
||||
ID: "getCourseLessons",
|
||||
Method: "GET",
|
||||
PathPattern: "/courselessons",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &CreateCourseReader{formats: a.formats},
|
||||
Reader: &GetCourseLessonsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
@ -73,33 +84,34 @@ func (a *Client) CreateCourse(params *CreateCourseParams, opts ...ClientOption)
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*CreateCourseCreated)
|
||||
success, ok := result.(*GetCourseLessonsOK)
|
||||
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 createCourse: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
msg := fmt.Sprintf("unexpected success response for getCourseLessons: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteCourse deletes a course
|
||||
GetCourseSections gets a list of course sections
|
||||
*/
|
||||
func (a *Client) DeleteCourse(params *DeleteCourseParams, opts ...ClientOption) (*DeleteCourseNoContent, error) {
|
||||
func (a *Client) GetCourseSections(params *GetCourseSectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCourseSectionsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteCourseParams()
|
||||
params = NewGetCourseSectionsParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "deleteCourse",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/courses",
|
||||
ID: "getCourseSections",
|
||||
Method: "GET",
|
||||
PathPattern: "/coursesections",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteCourseReader{formats: a.formats},
|
||||
Reader: &GetCourseSectionsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
@ -111,20 +123,20 @@ func (a *Client) DeleteCourse(params *DeleteCourseParams, opts ...ClientOption)
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*DeleteCourseNoContent)
|
||||
success, ok := result.(*GetCourseSectionsOK)
|
||||
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 deleteCourse: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
msg := fmt.Sprintf("unexpected success response for getCourseSections: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetCourses gets a list of courses
|
||||
*/
|
||||
func (a *Client) GetCourses(params *GetCoursesParams, opts ...ClientOption) (*GetCoursesOK, error) {
|
||||
func (a *Client) GetCourses(params *GetCoursesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCoursesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetCoursesParams()
|
||||
|
|
@ -138,6 +150,7 @@ func (a *Client) GetCourses(params *GetCoursesParams, opts ...ClientOption) (*Ge
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetCoursesReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
@ -160,22 +173,23 @@ func (a *Client) GetCourses(params *GetCoursesParams, opts ...ClientOption) (*Ge
|
|||
}
|
||||
|
||||
/*
|
||||
UpdateCourse updates an existing course
|
||||
PostCourseLessons creates a new course lesson
|
||||
*/
|
||||
func (a *Client) UpdateCourse(params *UpdateCourseParams, opts ...ClientOption) (*UpdateCourseOK, error) {
|
||||
func (a *Client) PostCourseLessons(params *PostCourseLessonsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostCourseLessonsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewUpdateCourseParams()
|
||||
params = NewPostCourseLessonsParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "updateCourse",
|
||||
Method: "PUT",
|
||||
PathPattern: "/courses",
|
||||
ID: "postCourseLessons",
|
||||
Method: "POST",
|
||||
PathPattern: "/courselessons",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &UpdateCourseReader{formats: a.formats},
|
||||
Reader: &PostCourseLessonsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
@ -187,13 +201,208 @@ func (a *Client) UpdateCourse(params *UpdateCourseParams, opts ...ClientOption)
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*UpdateCourseOK)
|
||||
success, ok := result.(*PostCourseLessonsOK)
|
||||
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 updateCourse: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
msg := fmt.Sprintf("unexpected success response for postCourseLessons: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostCourseSections creates a new course section
|
||||
*/
|
||||
func (a *Client) PostCourseSections(params *PostCourseSectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostCourseSectionsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostCourseSectionsParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postCourseSections",
|
||||
Method: "POST",
|
||||
PathPattern: "/coursesections",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostCourseSectionsReader{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.(*PostCourseSectionsOK)
|
||||
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 postCourseSections: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostCourses creates a new course
|
||||
*/
|
||||
func (a *Client) PostCourses(params *PostCoursesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostCoursesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostCoursesParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postCourses",
|
||||
Method: "POST",
|
||||
PathPattern: "/courses",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostCoursesReader{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.(*PostCoursesOK)
|
||||
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 postCourses: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourseLessons updates an existing course lesson
|
||||
*/
|
||||
func (a *Client) UpdateCourseLessons(params *UpdateCourseLessonsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCourseLessonsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewUpdateCourseLessonsParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "updateCourseLessons",
|
||||
Method: "PUT",
|
||||
PathPattern: "/courselessons",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &UpdateCourseLessonsReader{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.(*UpdateCourseLessonsOK)
|
||||
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 updateCourseLessons: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourseSections updates an existing course section
|
||||
*/
|
||||
func (a *Client) UpdateCourseSections(params *UpdateCourseSectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCourseSectionsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewUpdateCourseSectionsParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "updateCourseSections",
|
||||
Method: "PUT",
|
||||
PathPattern: "/coursesections",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &UpdateCourseSectionsReader{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.(*UpdateCourseSectionsOK)
|
||||
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 updateCourseSections: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourses updates an existing course
|
||||
*/
|
||||
func (a *Client) UpdateCourses(params *UpdateCoursesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCoursesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewUpdateCoursesParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "updateCourses",
|
||||
Method: "PUT",
|
||||
PathPattern: "/courses",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &UpdateCoursesReader{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.(*UpdateCoursesOK)
|
||||
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 updateCourses: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,157 +0,0 @@
|
|||
// 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 courses
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewCreateCourseParams creates a new CreateCourseParams 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 NewCreateCourseParams() *CreateCourseParams {
|
||||
return &CreateCourseParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateCourseParamsWithTimeout creates a new CreateCourseParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewCreateCourseParamsWithTimeout(timeout time.Duration) *CreateCourseParams {
|
||||
return &CreateCourseParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateCourseParamsWithContext creates a new CreateCourseParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewCreateCourseParamsWithContext(ctx context.Context) *CreateCourseParams {
|
||||
return &CreateCourseParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateCourseParamsWithHTTPClient creates a new CreateCourseParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewCreateCourseParamsWithHTTPClient(client *http.Client) *CreateCourseParams {
|
||||
return &CreateCourseParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateCourseParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the create course operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type CreateCourseParams struct {
|
||||
|
||||
/* CourseRequest.
|
||||
|
||||
An array of new Course records
|
||||
*/
|
||||
CourseRequest *members_models.CourseRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the create course params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *CreateCourseParams) WithDefaults() *CreateCourseParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the create course params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *CreateCourseParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the create course params
|
||||
func (o *CreateCourseParams) WithTimeout(timeout time.Duration) *CreateCourseParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the create course params
|
||||
func (o *CreateCourseParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the create course params
|
||||
func (o *CreateCourseParams) WithContext(ctx context.Context) *CreateCourseParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the create course params
|
||||
func (o *CreateCourseParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the create course params
|
||||
func (o *CreateCourseParams) WithHTTPClient(client *http.Client) *CreateCourseParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the create course params
|
||||
func (o *CreateCourseParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithCourseRequest adds the courseRequest to the create course params
|
||||
func (o *CreateCourseParams) WithCourseRequest(courseRequest *members_models.CourseRequest) *CreateCourseParams {
|
||||
o.SetCourseRequest(courseRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetCourseRequest adds the courseRequest to the create course params
|
||||
func (o *CreateCourseParams) SetCourseRequest(courseRequest *members_models.CourseRequest) {
|
||||
o.CourseRequest = courseRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *CreateCourseParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.CourseRequest != nil {
|
||||
if err := r.SetBodyParam(o.CourseRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 courses
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// CreateCourseReader is a Reader for the CreateCourse structure.
|
||||
type CreateCourseReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *CreateCourseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 201:
|
||||
result := NewCreateCourseCreated()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateCourseCreated creates a CreateCourseCreated with default headers values
|
||||
func NewCreateCourseCreated() *CreateCourseCreated {
|
||||
return &CreateCourseCreated{}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateCourseCreated describes a response with status code 201, with default header values.
|
||||
|
||||
Created
|
||||
*/
|
||||
type CreateCourseCreated struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this create course created response has a 2xx status code
|
||||
func (o *CreateCourseCreated) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this create course created response has a 3xx status code
|
||||
func (o *CreateCourseCreated) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this create course created response has a 4xx status code
|
||||
func (o *CreateCourseCreated) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this create course created response has a 5xx status code
|
||||
func (o *CreateCourseCreated) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this create course created response a status code equal to that given
|
||||
func (o *CreateCourseCreated) IsCode(code int) bool {
|
||||
return code == 201
|
||||
}
|
||||
|
||||
// Code gets the status code for the create course created response
|
||||
func (o *CreateCourseCreated) Code() int {
|
||||
return 201
|
||||
}
|
||||
|
||||
func (o *CreateCourseCreated) Error() string {
|
||||
return fmt.Sprintf("[POST /courses][%d] createCourseCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *CreateCourseCreated) String() string {
|
||||
return fmt.Sprintf("[POST /courses][%d] createCourseCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *CreateCourseCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,167 +0,0 @@
|
|||
// 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 courses
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewDeleteCourseParams creates a new DeleteCourseParams 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 NewDeleteCourseParams() *DeleteCourseParams {
|
||||
return &DeleteCourseParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteCourseParamsWithTimeout creates a new DeleteCourseParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewDeleteCourseParamsWithTimeout(timeout time.Duration) *DeleteCourseParams {
|
||||
return &DeleteCourseParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteCourseParamsWithContext creates a new DeleteCourseParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewDeleteCourseParamsWithContext(ctx context.Context) *DeleteCourseParams {
|
||||
return &DeleteCourseParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteCourseParamsWithHTTPClient creates a new DeleteCourseParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewDeleteCourseParamsWithHTTPClient(client *http.Client) *DeleteCourseParams {
|
||||
return &DeleteCourseParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteCourseParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the delete course operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type DeleteCourseParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Unique Record ID
|
||||
*/
|
||||
ID *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the delete course params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteCourseParams) WithDefaults() *DeleteCourseParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the delete course params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteCourseParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete course params
|
||||
func (o *DeleteCourseParams) WithTimeout(timeout time.Duration) *DeleteCourseParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete course params
|
||||
func (o *DeleteCourseParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete course params
|
||||
func (o *DeleteCourseParams) WithContext(ctx context.Context) *DeleteCourseParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete course params
|
||||
func (o *DeleteCourseParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete course params
|
||||
func (o *DeleteCourseParams) WithHTTPClient(client *http.Client) *DeleteCourseParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete course params
|
||||
func (o *DeleteCourseParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the delete course params
|
||||
func (o *DeleteCourseParams) WithID(id *string) *DeleteCourseParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the delete course params
|
||||
func (o *DeleteCourseParams) SetID(id *string) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *DeleteCourseParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.ID != nil {
|
||||
|
||||
// query param id
|
||||
var qrID string
|
||||
|
||||
if o.ID != nil {
|
||||
qrID = *o.ID
|
||||
}
|
||||
qID := qrID
|
||||
if qID != "" {
|
||||
|
||||
if err := r.SetQueryParam("id", qID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 courses
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// DeleteCourseReader is a Reader for the DeleteCourse structure.
|
||||
type DeleteCourseReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteCourseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 204:
|
||||
result := NewDeleteCourseNoContent()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteCourseNoContent creates a DeleteCourseNoContent with default headers values
|
||||
func NewDeleteCourseNoContent() *DeleteCourseNoContent {
|
||||
return &DeleteCourseNoContent{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteCourseNoContent describes a response with status code 204, with default header values.
|
||||
|
||||
No Content
|
||||
*/
|
||||
type DeleteCourseNoContent struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this delete course no content response has a 2xx status code
|
||||
func (o *DeleteCourseNoContent) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this delete course no content response has a 3xx status code
|
||||
func (o *DeleteCourseNoContent) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this delete course no content response has a 4xx status code
|
||||
func (o *DeleteCourseNoContent) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this delete course no content response has a 5xx status code
|
||||
func (o *DeleteCourseNoContent) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this delete course no content response a status code equal to that given
|
||||
func (o *DeleteCourseNoContent) IsCode(code int) bool {
|
||||
return code == 204
|
||||
}
|
||||
|
||||
// Code gets the status code for the delete course no content response
|
||||
func (o *DeleteCourseNoContent) Code() int {
|
||||
return 204
|
||||
}
|
||||
|
||||
func (o *DeleteCourseNoContent) Error() string {
|
||||
return fmt.Sprintf("[DELETE /courses][%d] deleteCourseNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *DeleteCourseNoContent) String() string {
|
||||
return fmt.Sprintf("[DELETE /courses][%d] deleteCourseNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *DeleteCourseNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package course_lessons
|
||||
package courses
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
|
@ -0,0 +1,486 @@
|
|||
// 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 courses
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// GetCourseLessonsReader is a Reader for the GetCourseLessons structure.
|
||||
type GetCourseLessonsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetCourseLessonsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetCourseLessonsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetCourseLessonsUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetCourseLessonsForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetCourseLessonsNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewGetCourseLessonsUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetCourseLessonsInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetCourseLessonsOK creates a GetCourseLessonsOK with default headers values
|
||||
func NewGetCourseLessonsOK() *GetCourseLessonsOK {
|
||||
return &GetCourseLessonsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCourseLessonsOK describes a response with status code 200, with default header values.
|
||||
|
||||
CourseLesson Response Object
|
||||
*/
|
||||
type GetCourseLessonsOK struct {
|
||||
Payload *members_models.CourseLessonResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get course lessons o k response has a 2xx status code
|
||||
func (o *GetCourseLessonsOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get course lessons o k response has a 3xx status code
|
||||
func (o *GetCourseLessonsOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get course lessons o k response has a 4xx status code
|
||||
func (o *GetCourseLessonsOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get course lessons o k response has a 5xx status code
|
||||
func (o *GetCourseLessonsOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get course lessons o k response a status code equal to that given
|
||||
func (o *GetCourseLessonsOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the get course lessons o k response
|
||||
func (o *GetCourseLessonsOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /courselessons][%d] getCourseLessonsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsOK) String() string {
|
||||
return fmt.Sprintf("[GET /courselessons][%d] getCourseLessonsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsOK) GetPayload() *members_models.CourseLessonResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.CourseLessonResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCourseLessonsUnauthorized creates a GetCourseLessonsUnauthorized with default headers values
|
||||
func NewGetCourseLessonsUnauthorized() *GetCourseLessonsUnauthorized {
|
||||
return &GetCourseLessonsUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCourseLessonsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetCourseLessonsUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get course lessons unauthorized response has a 2xx status code
|
||||
func (o *GetCourseLessonsUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get course lessons unauthorized response has a 3xx status code
|
||||
func (o *GetCourseLessonsUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get course lessons unauthorized response has a 4xx status code
|
||||
func (o *GetCourseLessonsUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get course lessons unauthorized response has a 5xx status code
|
||||
func (o *GetCourseLessonsUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get course lessons unauthorized response a status code equal to that given
|
||||
func (o *GetCourseLessonsUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the get course lessons unauthorized response
|
||||
func (o *GetCourseLessonsUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /courselessons][%d] getCourseLessonsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsUnauthorized) String() string {
|
||||
return fmt.Sprintf("[GET /courselessons][%d] getCourseLessonsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCourseLessonsForbidden creates a GetCourseLessonsForbidden with default headers values
|
||||
func NewGetCourseLessonsForbidden() *GetCourseLessonsForbidden {
|
||||
return &GetCourseLessonsForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCourseLessonsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetCourseLessonsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get course lessons forbidden response has a 2xx status code
|
||||
func (o *GetCourseLessonsForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get course lessons forbidden response has a 3xx status code
|
||||
func (o *GetCourseLessonsForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get course lessons forbidden response has a 4xx status code
|
||||
func (o *GetCourseLessonsForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get course lessons forbidden response has a 5xx status code
|
||||
func (o *GetCourseLessonsForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get course lessons forbidden response a status code equal to that given
|
||||
func (o *GetCourseLessonsForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the get course lessons forbidden response
|
||||
func (o *GetCourseLessonsForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /courselessons][%d] getCourseLessonsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsForbidden) String() string {
|
||||
return fmt.Sprintf("[GET /courselessons][%d] getCourseLessonsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsForbidden) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCourseLessonsNotFound creates a GetCourseLessonsNotFound with default headers values
|
||||
func NewGetCourseLessonsNotFound() *GetCourseLessonsNotFound {
|
||||
return &GetCourseLessonsNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCourseLessonsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetCourseLessonsNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get course lessons not found response has a 2xx status code
|
||||
func (o *GetCourseLessonsNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get course lessons not found response has a 3xx status code
|
||||
func (o *GetCourseLessonsNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get course lessons not found response has a 4xx status code
|
||||
func (o *GetCourseLessonsNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get course lessons not found response has a 5xx status code
|
||||
func (o *GetCourseLessonsNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get course lessons not found response a status code equal to that given
|
||||
func (o *GetCourseLessonsNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the get course lessons not found response
|
||||
func (o *GetCourseLessonsNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /courselessons][%d] getCourseLessonsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsNotFound) String() string {
|
||||
return fmt.Sprintf("[GET /courselessons][%d] getCourseLessonsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsNotFound) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCourseLessonsUnprocessableEntity creates a GetCourseLessonsUnprocessableEntity with default headers values
|
||||
func NewGetCourseLessonsUnprocessableEntity() *GetCourseLessonsUnprocessableEntity {
|
||||
return &GetCourseLessonsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCourseLessonsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type GetCourseLessonsUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get course lessons unprocessable entity response has a 2xx status code
|
||||
func (o *GetCourseLessonsUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get course lessons unprocessable entity response has a 3xx status code
|
||||
func (o *GetCourseLessonsUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get course lessons unprocessable entity response has a 4xx status code
|
||||
func (o *GetCourseLessonsUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get course lessons unprocessable entity response has a 5xx status code
|
||||
func (o *GetCourseLessonsUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get course lessons unprocessable entity response a status code equal to that given
|
||||
func (o *GetCourseLessonsUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the get course lessons unprocessable entity response
|
||||
func (o *GetCourseLessonsUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /courselessons][%d] getCourseLessonsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[GET /courselessons][%d] getCourseLessonsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCourseLessonsInternalServerError creates a GetCourseLessonsInternalServerError with default headers values
|
||||
func NewGetCourseLessonsInternalServerError() *GetCourseLessonsInternalServerError {
|
||||
return &GetCourseLessonsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCourseLessonsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetCourseLessonsInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get course lessons internal server error response has a 2xx status code
|
||||
func (o *GetCourseLessonsInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get course lessons internal server error response has a 3xx status code
|
||||
func (o *GetCourseLessonsInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get course lessons internal server error response has a 4xx status code
|
||||
func (o *GetCourseLessonsInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get course lessons internal server error response has a 5xx status code
|
||||
func (o *GetCourseLessonsInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this get course lessons internal server error response a status code equal to that given
|
||||
func (o *GetCourseLessonsInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the get course lessons internal server error response
|
||||
func (o *GetCourseLessonsInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /courselessons][%d] getCourseLessonsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[GET /courselessons][%d] getCourseLessonsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCourseLessonsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package course_sections
|
||||
package courses
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
|
@ -0,0 +1,486 @@
|
|||
// 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 courses
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// GetCourseSectionsReader is a Reader for the GetCourseSections structure.
|
||||
type GetCourseSectionsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetCourseSectionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetCourseSectionsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetCourseSectionsUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetCourseSectionsForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetCourseSectionsNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewGetCourseSectionsUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetCourseSectionsInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetCourseSectionsOK creates a GetCourseSectionsOK with default headers values
|
||||
func NewGetCourseSectionsOK() *GetCourseSectionsOK {
|
||||
return &GetCourseSectionsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCourseSectionsOK describes a response with status code 200, with default header values.
|
||||
|
||||
CourseSection Response Object
|
||||
*/
|
||||
type GetCourseSectionsOK struct {
|
||||
Payload *members_models.CourseSectionResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get course sections o k response has a 2xx status code
|
||||
func (o *GetCourseSectionsOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get course sections o k response has a 3xx status code
|
||||
func (o *GetCourseSectionsOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get course sections o k response has a 4xx status code
|
||||
func (o *GetCourseSectionsOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get course sections o k response has a 5xx status code
|
||||
func (o *GetCourseSectionsOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get course sections o k response a status code equal to that given
|
||||
func (o *GetCourseSectionsOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the get course sections o k response
|
||||
func (o *GetCourseSectionsOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsOK) String() string {
|
||||
return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsOK) GetPayload() *members_models.CourseSectionResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.CourseSectionResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCourseSectionsUnauthorized creates a GetCourseSectionsUnauthorized with default headers values
|
||||
func NewGetCourseSectionsUnauthorized() *GetCourseSectionsUnauthorized {
|
||||
return &GetCourseSectionsUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCourseSectionsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetCourseSectionsUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get course sections unauthorized response has a 2xx status code
|
||||
func (o *GetCourseSectionsUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get course sections unauthorized response has a 3xx status code
|
||||
func (o *GetCourseSectionsUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get course sections unauthorized response has a 4xx status code
|
||||
func (o *GetCourseSectionsUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get course sections unauthorized response has a 5xx status code
|
||||
func (o *GetCourseSectionsUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get course sections unauthorized response a status code equal to that given
|
||||
func (o *GetCourseSectionsUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the get course sections unauthorized response
|
||||
func (o *GetCourseSectionsUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsUnauthorized) String() string {
|
||||
return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCourseSectionsForbidden creates a GetCourseSectionsForbidden with default headers values
|
||||
func NewGetCourseSectionsForbidden() *GetCourseSectionsForbidden {
|
||||
return &GetCourseSectionsForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCourseSectionsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetCourseSectionsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get course sections forbidden response has a 2xx status code
|
||||
func (o *GetCourseSectionsForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get course sections forbidden response has a 3xx status code
|
||||
func (o *GetCourseSectionsForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get course sections forbidden response has a 4xx status code
|
||||
func (o *GetCourseSectionsForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get course sections forbidden response has a 5xx status code
|
||||
func (o *GetCourseSectionsForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get course sections forbidden response a status code equal to that given
|
||||
func (o *GetCourseSectionsForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the get course sections forbidden response
|
||||
func (o *GetCourseSectionsForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsForbidden) String() string {
|
||||
return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsForbidden) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCourseSectionsNotFound creates a GetCourseSectionsNotFound with default headers values
|
||||
func NewGetCourseSectionsNotFound() *GetCourseSectionsNotFound {
|
||||
return &GetCourseSectionsNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCourseSectionsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetCourseSectionsNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get course sections not found response has a 2xx status code
|
||||
func (o *GetCourseSectionsNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get course sections not found response has a 3xx status code
|
||||
func (o *GetCourseSectionsNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get course sections not found response has a 4xx status code
|
||||
func (o *GetCourseSectionsNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get course sections not found response has a 5xx status code
|
||||
func (o *GetCourseSectionsNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get course sections not found response a status code equal to that given
|
||||
func (o *GetCourseSectionsNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the get course sections not found response
|
||||
func (o *GetCourseSectionsNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsNotFound) String() string {
|
||||
return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsNotFound) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCourseSectionsUnprocessableEntity creates a GetCourseSectionsUnprocessableEntity with default headers values
|
||||
func NewGetCourseSectionsUnprocessableEntity() *GetCourseSectionsUnprocessableEntity {
|
||||
return &GetCourseSectionsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCourseSectionsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type GetCourseSectionsUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get course sections unprocessable entity response has a 2xx status code
|
||||
func (o *GetCourseSectionsUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get course sections unprocessable entity response has a 3xx status code
|
||||
func (o *GetCourseSectionsUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get course sections unprocessable entity response has a 4xx status code
|
||||
func (o *GetCourseSectionsUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get course sections unprocessable entity response has a 5xx status code
|
||||
func (o *GetCourseSectionsUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get course sections unprocessable entity response a status code equal to that given
|
||||
func (o *GetCourseSectionsUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the get course sections unprocessable entity response
|
||||
func (o *GetCourseSectionsUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCourseSectionsInternalServerError creates a GetCourseSectionsInternalServerError with default headers values
|
||||
func NewGetCourseSectionsInternalServerError() *GetCourseSectionsInternalServerError {
|
||||
return &GetCourseSectionsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCourseSectionsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetCourseSectionsInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get course sections internal server error response has a 2xx status code
|
||||
func (o *GetCourseSectionsInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get course sections internal server error response has a 3xx status code
|
||||
func (o *GetCourseSectionsInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get course sections internal server error response has a 4xx status code
|
||||
func (o *GetCourseSectionsInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get course sections internal server error response has a 5xx status code
|
||||
func (o *GetCourseSectionsInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this get course sections internal server error response a status code equal to that given
|
||||
func (o *GetCourseSectionsInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the get course sections internal server error response
|
||||
func (o *GetCourseSectionsInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCourseSectionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -11,9 +11,12 @@ package courses
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
)
|
||||
|
||||
// GetCoursesReader is a Reader for the GetCourses structure.
|
||||
|
|
@ -30,6 +33,36 @@ func (o *GetCoursesReader) ReadResponse(response runtime.ClientResponse, consume
|
|||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetCoursesUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetCoursesForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetCoursesNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewGetCoursesUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetCoursesInternalServerError()
|
||||
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())
|
||||
}
|
||||
|
|
@ -43,9 +76,10 @@ func NewGetCoursesOK() *GetCoursesOK {
|
|||
/*
|
||||
GetCoursesOK describes a response with status code 200, with default header values.
|
||||
|
||||
OK
|
||||
Course Response Object
|
||||
*/
|
||||
type GetCoursesOK struct {
|
||||
Payload *members_models.CourseResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get courses o k response has a 2xx status code
|
||||
|
|
@ -79,14 +113,374 @@ func (o *GetCoursesOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetCoursesOK) Error() string {
|
||||
return fmt.Sprintf("[GET /courses][%d] getCoursesOK ", 200)
|
||||
return fmt.Sprintf("[GET /courses][%d] getCoursesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCoursesOK) String() string {
|
||||
return fmt.Sprintf("[GET /courses][%d] getCoursesOK ", 200)
|
||||
return fmt.Sprintf("[GET /courses][%d] getCoursesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCoursesOK) GetPayload() *members_models.CourseResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCoursesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.CourseResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCoursesUnauthorized creates a GetCoursesUnauthorized with default headers values
|
||||
func NewGetCoursesUnauthorized() *GetCoursesUnauthorized {
|
||||
return &GetCoursesUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCoursesUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetCoursesUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get courses unauthorized response has a 2xx status code
|
||||
func (o *GetCoursesUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get courses unauthorized response has a 3xx status code
|
||||
func (o *GetCoursesUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get courses unauthorized response has a 4xx status code
|
||||
func (o *GetCoursesUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get courses unauthorized response has a 5xx status code
|
||||
func (o *GetCoursesUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get courses unauthorized response a status code equal to that given
|
||||
func (o *GetCoursesUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the get courses unauthorized response
|
||||
func (o *GetCoursesUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *GetCoursesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /courses][%d] getCoursesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCoursesUnauthorized) String() string {
|
||||
return fmt.Sprintf("[GET /courses][%d] getCoursesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCoursesUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCoursesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCoursesForbidden creates a GetCoursesForbidden with default headers values
|
||||
func NewGetCoursesForbidden() *GetCoursesForbidden {
|
||||
return &GetCoursesForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCoursesForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetCoursesForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get courses forbidden response has a 2xx status code
|
||||
func (o *GetCoursesForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get courses forbidden response has a 3xx status code
|
||||
func (o *GetCoursesForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get courses forbidden response has a 4xx status code
|
||||
func (o *GetCoursesForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get courses forbidden response has a 5xx status code
|
||||
func (o *GetCoursesForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get courses forbidden response a status code equal to that given
|
||||
func (o *GetCoursesForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the get courses forbidden response
|
||||
func (o *GetCoursesForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *GetCoursesForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /courses][%d] getCoursesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCoursesForbidden) String() string {
|
||||
return fmt.Sprintf("[GET /courses][%d] getCoursesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCoursesForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCoursesForbidden) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCoursesNotFound creates a GetCoursesNotFound with default headers values
|
||||
func NewGetCoursesNotFound() *GetCoursesNotFound {
|
||||
return &GetCoursesNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCoursesNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetCoursesNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get courses not found response has a 2xx status code
|
||||
func (o *GetCoursesNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get courses not found response has a 3xx status code
|
||||
func (o *GetCoursesNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get courses not found response has a 4xx status code
|
||||
func (o *GetCoursesNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get courses not found response has a 5xx status code
|
||||
func (o *GetCoursesNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get courses not found response a status code equal to that given
|
||||
func (o *GetCoursesNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the get courses not found response
|
||||
func (o *GetCoursesNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *GetCoursesNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /courses][%d] getCoursesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCoursesNotFound) String() string {
|
||||
return fmt.Sprintf("[GET /courses][%d] getCoursesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCoursesNotFound) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCoursesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCoursesUnprocessableEntity creates a GetCoursesUnprocessableEntity with default headers values
|
||||
func NewGetCoursesUnprocessableEntity() *GetCoursesUnprocessableEntity {
|
||||
return &GetCoursesUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCoursesUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type GetCoursesUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get courses unprocessable entity response has a 2xx status code
|
||||
func (o *GetCoursesUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get courses unprocessable entity response has a 3xx status code
|
||||
func (o *GetCoursesUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get courses unprocessable entity response has a 4xx status code
|
||||
func (o *GetCoursesUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get courses unprocessable entity response has a 5xx status code
|
||||
func (o *GetCoursesUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get courses unprocessable entity response a status code equal to that given
|
||||
func (o *GetCoursesUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the get courses unprocessable entity response
|
||||
func (o *GetCoursesUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *GetCoursesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /courses][%d] getCoursesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCoursesUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[GET /courses][%d] getCoursesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCoursesUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCoursesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCoursesInternalServerError creates a GetCoursesInternalServerError with default headers values
|
||||
func NewGetCoursesInternalServerError() *GetCoursesInternalServerError {
|
||||
return &GetCoursesInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCoursesInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetCoursesInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get courses internal server error response has a 2xx status code
|
||||
func (o *GetCoursesInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get courses internal server error response has a 3xx status code
|
||||
func (o *GetCoursesInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get courses internal server error response has a 4xx status code
|
||||
func (o *GetCoursesInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get courses internal server error response has a 5xx status code
|
||||
func (o *GetCoursesInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this get courses internal server error response a status code equal to that given
|
||||
func (o *GetCoursesInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the get courses internal server error response
|
||||
func (o *GetCoursesInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *GetCoursesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /courses][%d] getCoursesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCoursesInternalServerError) String() string {
|
||||
return fmt.Sprintf("[GET /courses][%d] getCoursesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCoursesInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCoursesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 courses
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewPostCourseLessonsParams creates a new PostCourseLessonsParams 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 NewPostCourseLessonsParams() *PostCourseLessonsParams {
|
||||
return &PostCourseLessonsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCourseLessonsParamsWithTimeout creates a new PostCourseLessonsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostCourseLessonsParamsWithTimeout(timeout time.Duration) *PostCourseLessonsParams {
|
||||
return &PostCourseLessonsParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCourseLessonsParamsWithContext creates a new PostCourseLessonsParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostCourseLessonsParamsWithContext(ctx context.Context) *PostCourseLessonsParams {
|
||||
return &PostCourseLessonsParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCourseLessonsParamsWithHTTPClient creates a new PostCourseLessonsParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostCourseLessonsParamsWithHTTPClient(client *http.Client) *PostCourseLessonsParams {
|
||||
return &PostCourseLessonsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCourseLessonsParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post course lessons operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostCourseLessonsParams struct {
|
||||
|
||||
/* CourselessonRequest.
|
||||
|
||||
An array of new CourseLesson records
|
||||
*/
|
||||
CourselessonRequest *members_models.CourseLessonRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post course lessons params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostCourseLessonsParams) WithDefaults() *PostCourseLessonsParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post course lessons params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostCourseLessonsParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post course lessons params
|
||||
func (o *PostCourseLessonsParams) WithTimeout(timeout time.Duration) *PostCourseLessonsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post course lessons params
|
||||
func (o *PostCourseLessonsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post course lessons params
|
||||
func (o *PostCourseLessonsParams) WithContext(ctx context.Context) *PostCourseLessonsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post course lessons params
|
||||
func (o *PostCourseLessonsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post course lessons params
|
||||
func (o *PostCourseLessonsParams) WithHTTPClient(client *http.Client) *PostCourseLessonsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post course lessons params
|
||||
func (o *PostCourseLessonsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithCourselessonRequest adds the courselessonRequest to the post course lessons params
|
||||
func (o *PostCourseLessonsParams) WithCourselessonRequest(courselessonRequest *members_models.CourseLessonRequest) *PostCourseLessonsParams {
|
||||
o.SetCourselessonRequest(courselessonRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetCourselessonRequest adds the courselessonRequest to the post course lessons params
|
||||
func (o *PostCourseLessonsParams) SetCourselessonRequest(courselessonRequest *members_models.CourseLessonRequest) {
|
||||
o.CourselessonRequest = courselessonRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostCourseLessonsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.CourselessonRequest != nil {
|
||||
if err := r.SetBodyParam(o.CourselessonRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,486 @@
|
|||
// 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 courses
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// PostCourseLessonsReader is a Reader for the PostCourseLessons structure.
|
||||
type PostCourseLessonsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostCourseLessonsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostCourseLessonsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPostCourseLessonsUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPostCourseLessonsForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPostCourseLessonsNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPostCourseLessonsUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPostCourseLessonsInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCourseLessonsOK creates a PostCourseLessonsOK with default headers values
|
||||
func NewPostCourseLessonsOK() *PostCourseLessonsOK {
|
||||
return &PostCourseLessonsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCourseLessonsOK describes a response with status code 200, with default header values.
|
||||
|
||||
CourseLesson Response Object
|
||||
*/
|
||||
type PostCourseLessonsOK struct {
|
||||
Payload *members_models.CourseLessonResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post course lessons o k response has a 2xx status code
|
||||
func (o *PostCourseLessonsOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post course lessons o k response has a 3xx status code
|
||||
func (o *PostCourseLessonsOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post course lessons o k response has a 4xx status code
|
||||
func (o *PostCourseLessonsOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post course lessons o k response has a 5xx status code
|
||||
func (o *PostCourseLessonsOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post course lessons o k response a status code equal to that given
|
||||
func (o *PostCourseLessonsOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the post course lessons o k response
|
||||
func (o *PostCourseLessonsOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsOK) Error() string {
|
||||
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsOK) String() string {
|
||||
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsOK) GetPayload() *members_models.CourseLessonResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.CourseLessonResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCourseLessonsUnauthorized creates a PostCourseLessonsUnauthorized with default headers values
|
||||
func NewPostCourseLessonsUnauthorized() *PostCourseLessonsUnauthorized {
|
||||
return &PostCourseLessonsUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCourseLessonsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PostCourseLessonsUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post course lessons unauthorized response has a 2xx status code
|
||||
func (o *PostCourseLessonsUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post course lessons unauthorized response has a 3xx status code
|
||||
func (o *PostCourseLessonsUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post course lessons unauthorized response has a 4xx status code
|
||||
func (o *PostCourseLessonsUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post course lessons unauthorized response has a 5xx status code
|
||||
func (o *PostCourseLessonsUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post course lessons unauthorized response a status code equal to that given
|
||||
func (o *PostCourseLessonsUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the post course lessons unauthorized response
|
||||
func (o *PostCourseLessonsUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsUnauthorized) String() string {
|
||||
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCourseLessonsForbidden creates a PostCourseLessonsForbidden with default headers values
|
||||
func NewPostCourseLessonsForbidden() *PostCourseLessonsForbidden {
|
||||
return &PostCourseLessonsForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCourseLessonsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PostCourseLessonsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post course lessons forbidden response has a 2xx status code
|
||||
func (o *PostCourseLessonsForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post course lessons forbidden response has a 3xx status code
|
||||
func (o *PostCourseLessonsForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post course lessons forbidden response has a 4xx status code
|
||||
func (o *PostCourseLessonsForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post course lessons forbidden response has a 5xx status code
|
||||
func (o *PostCourseLessonsForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post course lessons forbidden response a status code equal to that given
|
||||
func (o *PostCourseLessonsForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the post course lessons forbidden response
|
||||
func (o *PostCourseLessonsForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsForbidden) String() string {
|
||||
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsForbidden) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCourseLessonsNotFound creates a PostCourseLessonsNotFound with default headers values
|
||||
func NewPostCourseLessonsNotFound() *PostCourseLessonsNotFound {
|
||||
return &PostCourseLessonsNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCourseLessonsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PostCourseLessonsNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post course lessons not found response has a 2xx status code
|
||||
func (o *PostCourseLessonsNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post course lessons not found response has a 3xx status code
|
||||
func (o *PostCourseLessonsNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post course lessons not found response has a 4xx status code
|
||||
func (o *PostCourseLessonsNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post course lessons not found response has a 5xx status code
|
||||
func (o *PostCourseLessonsNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post course lessons not found response a status code equal to that given
|
||||
func (o *PostCourseLessonsNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the post course lessons not found response
|
||||
func (o *PostCourseLessonsNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsNotFound) String() string {
|
||||
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsNotFound) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCourseLessonsUnprocessableEntity creates a PostCourseLessonsUnprocessableEntity with default headers values
|
||||
func NewPostCourseLessonsUnprocessableEntity() *PostCourseLessonsUnprocessableEntity {
|
||||
return &PostCourseLessonsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCourseLessonsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type PostCourseLessonsUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post course lessons unprocessable entity response has a 2xx status code
|
||||
func (o *PostCourseLessonsUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post course lessons unprocessable entity response has a 3xx status code
|
||||
func (o *PostCourseLessonsUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post course lessons unprocessable entity response has a 4xx status code
|
||||
func (o *PostCourseLessonsUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post course lessons unprocessable entity response has a 5xx status code
|
||||
func (o *PostCourseLessonsUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post course lessons unprocessable entity response a status code equal to that given
|
||||
func (o *PostCourseLessonsUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the post course lessons unprocessable entity response
|
||||
func (o *PostCourseLessonsUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCourseLessonsInternalServerError creates a PostCourseLessonsInternalServerError with default headers values
|
||||
func NewPostCourseLessonsInternalServerError() *PostCourseLessonsInternalServerError {
|
||||
return &PostCourseLessonsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCourseLessonsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PostCourseLessonsInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post course lessons internal server error response has a 2xx status code
|
||||
func (o *PostCourseLessonsInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post course lessons internal server error response has a 3xx status code
|
||||
func (o *PostCourseLessonsInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post course lessons internal server error response has a 4xx status code
|
||||
func (o *PostCourseLessonsInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post course lessons internal server error response has a 5xx status code
|
||||
func (o *PostCourseLessonsInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this post course lessons internal server error response a status code equal to that given
|
||||
func (o *PostCourseLessonsInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the post course lessons internal server error response
|
||||
func (o *PostCourseLessonsInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCourseLessonsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -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 courses
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewPostCourseSectionsParams creates a new PostCourseSectionsParams 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 NewPostCourseSectionsParams() *PostCourseSectionsParams {
|
||||
return &PostCourseSectionsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCourseSectionsParamsWithTimeout creates a new PostCourseSectionsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostCourseSectionsParamsWithTimeout(timeout time.Duration) *PostCourseSectionsParams {
|
||||
return &PostCourseSectionsParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCourseSectionsParamsWithContext creates a new PostCourseSectionsParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostCourseSectionsParamsWithContext(ctx context.Context) *PostCourseSectionsParams {
|
||||
return &PostCourseSectionsParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCourseSectionsParamsWithHTTPClient creates a new PostCourseSectionsParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostCourseSectionsParamsWithHTTPClient(client *http.Client) *PostCourseSectionsParams {
|
||||
return &PostCourseSectionsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCourseSectionsParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post course sections operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostCourseSectionsParams struct {
|
||||
|
||||
/* CoursesectionRequest.
|
||||
|
||||
An array of new CourseSection records
|
||||
*/
|
||||
CoursesectionRequest *members_models.CourseSectionRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post course sections params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostCourseSectionsParams) WithDefaults() *PostCourseSectionsParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post course sections params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostCourseSectionsParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post course sections params
|
||||
func (o *PostCourseSectionsParams) WithTimeout(timeout time.Duration) *PostCourseSectionsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post course sections params
|
||||
func (o *PostCourseSectionsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post course sections params
|
||||
func (o *PostCourseSectionsParams) WithContext(ctx context.Context) *PostCourseSectionsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post course sections params
|
||||
func (o *PostCourseSectionsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post course sections params
|
||||
func (o *PostCourseSectionsParams) WithHTTPClient(client *http.Client) *PostCourseSectionsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post course sections params
|
||||
func (o *PostCourseSectionsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithCoursesectionRequest adds the coursesectionRequest to the post course sections params
|
||||
func (o *PostCourseSectionsParams) WithCoursesectionRequest(coursesectionRequest *members_models.CourseSectionRequest) *PostCourseSectionsParams {
|
||||
o.SetCoursesectionRequest(coursesectionRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetCoursesectionRequest adds the coursesectionRequest to the post course sections params
|
||||
func (o *PostCourseSectionsParams) SetCoursesectionRequest(coursesectionRequest *members_models.CourseSectionRequest) {
|
||||
o.CoursesectionRequest = coursesectionRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostCourseSectionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.CoursesectionRequest != nil {
|
||||
if err := r.SetBodyParam(o.CoursesectionRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,486 @@
|
|||
// 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 courses
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// PostCourseSectionsReader is a Reader for the PostCourseSections structure.
|
||||
type PostCourseSectionsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostCourseSectionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostCourseSectionsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPostCourseSectionsUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPostCourseSectionsForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPostCourseSectionsNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPostCourseSectionsUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPostCourseSectionsInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCourseSectionsOK creates a PostCourseSectionsOK with default headers values
|
||||
func NewPostCourseSectionsOK() *PostCourseSectionsOK {
|
||||
return &PostCourseSectionsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCourseSectionsOK describes a response with status code 200, with default header values.
|
||||
|
||||
CourseSection Response Object
|
||||
*/
|
||||
type PostCourseSectionsOK struct {
|
||||
Payload *members_models.CourseSectionResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post course sections o k response has a 2xx status code
|
||||
func (o *PostCourseSectionsOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post course sections o k response has a 3xx status code
|
||||
func (o *PostCourseSectionsOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post course sections o k response has a 4xx status code
|
||||
func (o *PostCourseSectionsOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post course sections o k response has a 5xx status code
|
||||
func (o *PostCourseSectionsOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post course sections o k response a status code equal to that given
|
||||
func (o *PostCourseSectionsOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the post course sections o k response
|
||||
func (o *PostCourseSectionsOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsOK) Error() string {
|
||||
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsOK) String() string {
|
||||
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsOK) GetPayload() *members_models.CourseSectionResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.CourseSectionResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCourseSectionsUnauthorized creates a PostCourseSectionsUnauthorized with default headers values
|
||||
func NewPostCourseSectionsUnauthorized() *PostCourseSectionsUnauthorized {
|
||||
return &PostCourseSectionsUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCourseSectionsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PostCourseSectionsUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post course sections unauthorized response has a 2xx status code
|
||||
func (o *PostCourseSectionsUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post course sections unauthorized response has a 3xx status code
|
||||
func (o *PostCourseSectionsUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post course sections unauthorized response has a 4xx status code
|
||||
func (o *PostCourseSectionsUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post course sections unauthorized response has a 5xx status code
|
||||
func (o *PostCourseSectionsUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post course sections unauthorized response a status code equal to that given
|
||||
func (o *PostCourseSectionsUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the post course sections unauthorized response
|
||||
func (o *PostCourseSectionsUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsUnauthorized) String() string {
|
||||
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCourseSectionsForbidden creates a PostCourseSectionsForbidden with default headers values
|
||||
func NewPostCourseSectionsForbidden() *PostCourseSectionsForbidden {
|
||||
return &PostCourseSectionsForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCourseSectionsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PostCourseSectionsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post course sections forbidden response has a 2xx status code
|
||||
func (o *PostCourseSectionsForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post course sections forbidden response has a 3xx status code
|
||||
func (o *PostCourseSectionsForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post course sections forbidden response has a 4xx status code
|
||||
func (o *PostCourseSectionsForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post course sections forbidden response has a 5xx status code
|
||||
func (o *PostCourseSectionsForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post course sections forbidden response a status code equal to that given
|
||||
func (o *PostCourseSectionsForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the post course sections forbidden response
|
||||
func (o *PostCourseSectionsForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsForbidden) String() string {
|
||||
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsForbidden) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCourseSectionsNotFound creates a PostCourseSectionsNotFound with default headers values
|
||||
func NewPostCourseSectionsNotFound() *PostCourseSectionsNotFound {
|
||||
return &PostCourseSectionsNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCourseSectionsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PostCourseSectionsNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post course sections not found response has a 2xx status code
|
||||
func (o *PostCourseSectionsNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post course sections not found response has a 3xx status code
|
||||
func (o *PostCourseSectionsNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post course sections not found response has a 4xx status code
|
||||
func (o *PostCourseSectionsNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post course sections not found response has a 5xx status code
|
||||
func (o *PostCourseSectionsNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post course sections not found response a status code equal to that given
|
||||
func (o *PostCourseSectionsNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the post course sections not found response
|
||||
func (o *PostCourseSectionsNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsNotFound) String() string {
|
||||
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsNotFound) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCourseSectionsUnprocessableEntity creates a PostCourseSectionsUnprocessableEntity with default headers values
|
||||
func NewPostCourseSectionsUnprocessableEntity() *PostCourseSectionsUnprocessableEntity {
|
||||
return &PostCourseSectionsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCourseSectionsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type PostCourseSectionsUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post course sections unprocessable entity response has a 2xx status code
|
||||
func (o *PostCourseSectionsUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post course sections unprocessable entity response has a 3xx status code
|
||||
func (o *PostCourseSectionsUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post course sections unprocessable entity response has a 4xx status code
|
||||
func (o *PostCourseSectionsUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post course sections unprocessable entity response has a 5xx status code
|
||||
func (o *PostCourseSectionsUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post course sections unprocessable entity response a status code equal to that given
|
||||
func (o *PostCourseSectionsUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the post course sections unprocessable entity response
|
||||
func (o *PostCourseSectionsUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCourseSectionsInternalServerError creates a PostCourseSectionsInternalServerError with default headers values
|
||||
func NewPostCourseSectionsInternalServerError() *PostCourseSectionsInternalServerError {
|
||||
return &PostCourseSectionsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCourseSectionsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PostCourseSectionsInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post course sections internal server error response has a 2xx status code
|
||||
func (o *PostCourseSectionsInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post course sections internal server error response has a 3xx status code
|
||||
func (o *PostCourseSectionsInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post course sections internal server error response has a 4xx status code
|
||||
func (o *PostCourseSectionsInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post course sections internal server error response has a 5xx status code
|
||||
func (o *PostCourseSectionsInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this post course sections internal server error response a status code equal to that given
|
||||
func (o *PostCourseSectionsInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the post course sections internal server error response
|
||||
func (o *PostCourseSectionsInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCourseSectionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -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 courses
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewPostCoursesParams creates a new PostCoursesParams 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 NewPostCoursesParams() *PostCoursesParams {
|
||||
return &PostCoursesParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCoursesParamsWithTimeout creates a new PostCoursesParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostCoursesParamsWithTimeout(timeout time.Duration) *PostCoursesParams {
|
||||
return &PostCoursesParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCoursesParamsWithContext creates a new PostCoursesParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostCoursesParamsWithContext(ctx context.Context) *PostCoursesParams {
|
||||
return &PostCoursesParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCoursesParamsWithHTTPClient creates a new PostCoursesParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostCoursesParamsWithHTTPClient(client *http.Client) *PostCoursesParams {
|
||||
return &PostCoursesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCoursesParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post courses operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostCoursesParams struct {
|
||||
|
||||
/* CourseRequest.
|
||||
|
||||
An array of new Course records
|
||||
*/
|
||||
CourseRequest *members_models.CourseRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post courses params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostCoursesParams) WithDefaults() *PostCoursesParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post courses params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostCoursesParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post courses params
|
||||
func (o *PostCoursesParams) WithTimeout(timeout time.Duration) *PostCoursesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post courses params
|
||||
func (o *PostCoursesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post courses params
|
||||
func (o *PostCoursesParams) WithContext(ctx context.Context) *PostCoursesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post courses params
|
||||
func (o *PostCoursesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post courses params
|
||||
func (o *PostCoursesParams) WithHTTPClient(client *http.Client) *PostCoursesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post courses params
|
||||
func (o *PostCoursesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithCourseRequest adds the courseRequest to the post courses params
|
||||
func (o *PostCoursesParams) WithCourseRequest(courseRequest *members_models.CourseRequest) *PostCoursesParams {
|
||||
o.SetCourseRequest(courseRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetCourseRequest adds the courseRequest to the post courses params
|
||||
func (o *PostCoursesParams) SetCourseRequest(courseRequest *members_models.CourseRequest) {
|
||||
o.CourseRequest = courseRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostCoursesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.CourseRequest != nil {
|
||||
if err := r.SetBodyParam(o.CourseRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,486 @@
|
|||
// 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 courses
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// PostCoursesReader is a Reader for the PostCourses structure.
|
||||
type PostCoursesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostCoursesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostCoursesOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPostCoursesUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPostCoursesForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPostCoursesNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPostCoursesUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPostCoursesInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCoursesOK creates a PostCoursesOK with default headers values
|
||||
func NewPostCoursesOK() *PostCoursesOK {
|
||||
return &PostCoursesOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCoursesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Course Response Object
|
||||
*/
|
||||
type PostCoursesOK struct {
|
||||
Payload *members_models.CourseResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post courses o k response has a 2xx status code
|
||||
func (o *PostCoursesOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post courses o k response has a 3xx status code
|
||||
func (o *PostCoursesOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post courses o k response has a 4xx status code
|
||||
func (o *PostCoursesOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post courses o k response has a 5xx status code
|
||||
func (o *PostCoursesOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post courses o k response a status code equal to that given
|
||||
func (o *PostCoursesOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the post courses o k response
|
||||
func (o *PostCoursesOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *PostCoursesOK) Error() string {
|
||||
return fmt.Sprintf("[POST /courses][%d] postCoursesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCoursesOK) String() string {
|
||||
return fmt.Sprintf("[POST /courses][%d] postCoursesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCoursesOK) GetPayload() *members_models.CourseResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCoursesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.CourseResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCoursesUnauthorized creates a PostCoursesUnauthorized with default headers values
|
||||
func NewPostCoursesUnauthorized() *PostCoursesUnauthorized {
|
||||
return &PostCoursesUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCoursesUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PostCoursesUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post courses unauthorized response has a 2xx status code
|
||||
func (o *PostCoursesUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post courses unauthorized response has a 3xx status code
|
||||
func (o *PostCoursesUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post courses unauthorized response has a 4xx status code
|
||||
func (o *PostCoursesUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post courses unauthorized response has a 5xx status code
|
||||
func (o *PostCoursesUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post courses unauthorized response a status code equal to that given
|
||||
func (o *PostCoursesUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the post courses unauthorized response
|
||||
func (o *PostCoursesUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *PostCoursesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /courses][%d] postCoursesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCoursesUnauthorized) String() string {
|
||||
return fmt.Sprintf("[POST /courses][%d] postCoursesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCoursesUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCoursesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCoursesForbidden creates a PostCoursesForbidden with default headers values
|
||||
func NewPostCoursesForbidden() *PostCoursesForbidden {
|
||||
return &PostCoursesForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCoursesForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PostCoursesForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post courses forbidden response has a 2xx status code
|
||||
func (o *PostCoursesForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post courses forbidden response has a 3xx status code
|
||||
func (o *PostCoursesForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post courses forbidden response has a 4xx status code
|
||||
func (o *PostCoursesForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post courses forbidden response has a 5xx status code
|
||||
func (o *PostCoursesForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post courses forbidden response a status code equal to that given
|
||||
func (o *PostCoursesForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the post courses forbidden response
|
||||
func (o *PostCoursesForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *PostCoursesForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /courses][%d] postCoursesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCoursesForbidden) String() string {
|
||||
return fmt.Sprintf("[POST /courses][%d] postCoursesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCoursesForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCoursesForbidden) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCoursesNotFound creates a PostCoursesNotFound with default headers values
|
||||
func NewPostCoursesNotFound() *PostCoursesNotFound {
|
||||
return &PostCoursesNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCoursesNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PostCoursesNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post courses not found response has a 2xx status code
|
||||
func (o *PostCoursesNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post courses not found response has a 3xx status code
|
||||
func (o *PostCoursesNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post courses not found response has a 4xx status code
|
||||
func (o *PostCoursesNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post courses not found response has a 5xx status code
|
||||
func (o *PostCoursesNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post courses not found response a status code equal to that given
|
||||
func (o *PostCoursesNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the post courses not found response
|
||||
func (o *PostCoursesNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *PostCoursesNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /courses][%d] postCoursesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCoursesNotFound) String() string {
|
||||
return fmt.Sprintf("[POST /courses][%d] postCoursesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCoursesNotFound) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCoursesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCoursesUnprocessableEntity creates a PostCoursesUnprocessableEntity with default headers values
|
||||
func NewPostCoursesUnprocessableEntity() *PostCoursesUnprocessableEntity {
|
||||
return &PostCoursesUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCoursesUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type PostCoursesUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post courses unprocessable entity response has a 2xx status code
|
||||
func (o *PostCoursesUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post courses unprocessable entity response has a 3xx status code
|
||||
func (o *PostCoursesUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post courses unprocessable entity response has a 4xx status code
|
||||
func (o *PostCoursesUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post courses unprocessable entity response has a 5xx status code
|
||||
func (o *PostCoursesUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post courses unprocessable entity response a status code equal to that given
|
||||
func (o *PostCoursesUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the post courses unprocessable entity response
|
||||
func (o *PostCoursesUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *PostCoursesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /courses][%d] postCoursesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCoursesUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[POST /courses][%d] postCoursesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCoursesUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCoursesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCoursesInternalServerError creates a PostCoursesInternalServerError with default headers values
|
||||
func NewPostCoursesInternalServerError() *PostCoursesInternalServerError {
|
||||
return &PostCoursesInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCoursesInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PostCoursesInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post courses internal server error response has a 2xx status code
|
||||
func (o *PostCoursesInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post courses internal server error response has a 3xx status code
|
||||
func (o *PostCoursesInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post courses internal server error response has a 4xx status code
|
||||
func (o *PostCoursesInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post courses internal server error response has a 5xx status code
|
||||
func (o *PostCoursesInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this post courses internal server error response a status code equal to that given
|
||||
func (o *PostCoursesInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the post courses internal server error response
|
||||
func (o *PostCoursesInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *PostCoursesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /courses][%d] postCoursesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCoursesInternalServerError) String() string {
|
||||
return fmt.Sprintf("[POST /courses][%d] postCoursesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCoursesInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCoursesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -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 courses
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewUpdateCourseLessonsParams creates a new UpdateCourseLessonsParams 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 NewUpdateCourseLessonsParams() *UpdateCourseLessonsParams {
|
||||
return &UpdateCourseLessonsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateCourseLessonsParamsWithTimeout creates a new UpdateCourseLessonsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewUpdateCourseLessonsParamsWithTimeout(timeout time.Duration) *UpdateCourseLessonsParams {
|
||||
return &UpdateCourseLessonsParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateCourseLessonsParamsWithContext creates a new UpdateCourseLessonsParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewUpdateCourseLessonsParamsWithContext(ctx context.Context) *UpdateCourseLessonsParams {
|
||||
return &UpdateCourseLessonsParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateCourseLessonsParamsWithHTTPClient creates a new UpdateCourseLessonsParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewUpdateCourseLessonsParamsWithHTTPClient(client *http.Client) *UpdateCourseLessonsParams {
|
||||
return &UpdateCourseLessonsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourseLessonsParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the update course lessons operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type UpdateCourseLessonsParams struct {
|
||||
|
||||
/* CourselessonRequest.
|
||||
|
||||
An array of new CourseLesson records
|
||||
*/
|
||||
CourselessonRequest *members_models.CourseLessonRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the update course lessons params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *UpdateCourseLessonsParams) WithDefaults() *UpdateCourseLessonsParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the update course lessons params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *UpdateCourseLessonsParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the update course lessons params
|
||||
func (o *UpdateCourseLessonsParams) WithTimeout(timeout time.Duration) *UpdateCourseLessonsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the update course lessons params
|
||||
func (o *UpdateCourseLessonsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the update course lessons params
|
||||
func (o *UpdateCourseLessonsParams) WithContext(ctx context.Context) *UpdateCourseLessonsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the update course lessons params
|
||||
func (o *UpdateCourseLessonsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the update course lessons params
|
||||
func (o *UpdateCourseLessonsParams) WithHTTPClient(client *http.Client) *UpdateCourseLessonsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the update course lessons params
|
||||
func (o *UpdateCourseLessonsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithCourselessonRequest adds the courselessonRequest to the update course lessons params
|
||||
func (o *UpdateCourseLessonsParams) WithCourselessonRequest(courselessonRequest *members_models.CourseLessonRequest) *UpdateCourseLessonsParams {
|
||||
o.SetCourselessonRequest(courselessonRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetCourselessonRequest adds the courselessonRequest to the update course lessons params
|
||||
func (o *UpdateCourseLessonsParams) SetCourselessonRequest(courselessonRequest *members_models.CourseLessonRequest) {
|
||||
o.CourselessonRequest = courselessonRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *UpdateCourseLessonsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.CourselessonRequest != nil {
|
||||
if err := r.SetBodyParam(o.CourselessonRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,486 @@
|
|||
// 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 courses
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// UpdateCourseLessonsReader is a Reader for the UpdateCourseLessons structure.
|
||||
type UpdateCourseLessonsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *UpdateCourseLessonsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewUpdateCourseLessonsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewUpdateCourseLessonsUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewUpdateCourseLessonsForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewUpdateCourseLessonsNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewUpdateCourseLessonsUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewUpdateCourseLessonsInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateCourseLessonsOK creates a UpdateCourseLessonsOK with default headers values
|
||||
func NewUpdateCourseLessonsOK() *UpdateCourseLessonsOK {
|
||||
return &UpdateCourseLessonsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourseLessonsOK describes a response with status code 200, with default header values.
|
||||
|
||||
CourseLesson Response Object
|
||||
*/
|
||||
type UpdateCourseLessonsOK struct {
|
||||
Payload *members_models.CourseLessonResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update course lessons o k response has a 2xx status code
|
||||
func (o *UpdateCourseLessonsOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update course lessons o k response has a 3xx status code
|
||||
func (o *UpdateCourseLessonsOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update course lessons o k response has a 4xx status code
|
||||
func (o *UpdateCourseLessonsOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update course lessons o k response has a 5xx status code
|
||||
func (o *UpdateCourseLessonsOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update course lessons o k response a status code equal to that given
|
||||
func (o *UpdateCourseLessonsOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the update course lessons o k response
|
||||
func (o *UpdateCourseLessonsOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsOK) String() string {
|
||||
return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsOK) GetPayload() *members_models.CourseLessonResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.CourseLessonResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewUpdateCourseLessonsUnauthorized creates a UpdateCourseLessonsUnauthorized with default headers values
|
||||
func NewUpdateCourseLessonsUnauthorized() *UpdateCourseLessonsUnauthorized {
|
||||
return &UpdateCourseLessonsUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourseLessonsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type UpdateCourseLessonsUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update course lessons unauthorized response has a 2xx status code
|
||||
func (o *UpdateCourseLessonsUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update course lessons unauthorized response has a 3xx status code
|
||||
func (o *UpdateCourseLessonsUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update course lessons unauthorized response has a 4xx status code
|
||||
func (o *UpdateCourseLessonsUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update course lessons unauthorized response has a 5xx status code
|
||||
func (o *UpdateCourseLessonsUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update course lessons unauthorized response a status code equal to that given
|
||||
func (o *UpdateCourseLessonsUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the update course lessons unauthorized response
|
||||
func (o *UpdateCourseLessonsUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsUnauthorized) String() string {
|
||||
return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewUpdateCourseLessonsForbidden creates a UpdateCourseLessonsForbidden with default headers values
|
||||
func NewUpdateCourseLessonsForbidden() *UpdateCourseLessonsForbidden {
|
||||
return &UpdateCourseLessonsForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourseLessonsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type UpdateCourseLessonsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update course lessons forbidden response has a 2xx status code
|
||||
func (o *UpdateCourseLessonsForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update course lessons forbidden response has a 3xx status code
|
||||
func (o *UpdateCourseLessonsForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update course lessons forbidden response has a 4xx status code
|
||||
func (o *UpdateCourseLessonsForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update course lessons forbidden response has a 5xx status code
|
||||
func (o *UpdateCourseLessonsForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update course lessons forbidden response a status code equal to that given
|
||||
func (o *UpdateCourseLessonsForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the update course lessons forbidden response
|
||||
func (o *UpdateCourseLessonsForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsForbidden) Error() string {
|
||||
return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsForbidden) String() string {
|
||||
return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsForbidden) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewUpdateCourseLessonsNotFound creates a UpdateCourseLessonsNotFound with default headers values
|
||||
func NewUpdateCourseLessonsNotFound() *UpdateCourseLessonsNotFound {
|
||||
return &UpdateCourseLessonsNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourseLessonsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type UpdateCourseLessonsNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update course lessons not found response has a 2xx status code
|
||||
func (o *UpdateCourseLessonsNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update course lessons not found response has a 3xx status code
|
||||
func (o *UpdateCourseLessonsNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update course lessons not found response has a 4xx status code
|
||||
func (o *UpdateCourseLessonsNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update course lessons not found response has a 5xx status code
|
||||
func (o *UpdateCourseLessonsNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update course lessons not found response a status code equal to that given
|
||||
func (o *UpdateCourseLessonsNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the update course lessons not found response
|
||||
func (o *UpdateCourseLessonsNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsNotFound) Error() string {
|
||||
return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsNotFound) String() string {
|
||||
return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsNotFound) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewUpdateCourseLessonsUnprocessableEntity creates a UpdateCourseLessonsUnprocessableEntity with default headers values
|
||||
func NewUpdateCourseLessonsUnprocessableEntity() *UpdateCourseLessonsUnprocessableEntity {
|
||||
return &UpdateCourseLessonsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourseLessonsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type UpdateCourseLessonsUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update course lessons unprocessable entity response has a 2xx status code
|
||||
func (o *UpdateCourseLessonsUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update course lessons unprocessable entity response has a 3xx status code
|
||||
func (o *UpdateCourseLessonsUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update course lessons unprocessable entity response has a 4xx status code
|
||||
func (o *UpdateCourseLessonsUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update course lessons unprocessable entity response has a 5xx status code
|
||||
func (o *UpdateCourseLessonsUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update course lessons unprocessable entity response a status code equal to that given
|
||||
func (o *UpdateCourseLessonsUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the update course lessons unprocessable entity response
|
||||
func (o *UpdateCourseLessonsUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewUpdateCourseLessonsInternalServerError creates a UpdateCourseLessonsInternalServerError with default headers values
|
||||
func NewUpdateCourseLessonsInternalServerError() *UpdateCourseLessonsInternalServerError {
|
||||
return &UpdateCourseLessonsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourseLessonsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type UpdateCourseLessonsInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update course lessons internal server error response has a 2xx status code
|
||||
func (o *UpdateCourseLessonsInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update course lessons internal server error response has a 3xx status code
|
||||
func (o *UpdateCourseLessonsInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update course lessons internal server error response has a 4xx status code
|
||||
func (o *UpdateCourseLessonsInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update course lessons internal server error response has a 5xx status code
|
||||
func (o *UpdateCourseLessonsInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this update course lessons internal server error response a status code equal to that given
|
||||
func (o *UpdateCourseLessonsInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the update course lessons internal server error response
|
||||
func (o *UpdateCourseLessonsInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateCourseLessonsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,167 +0,0 @@
|
|||
// 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 courses
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewUpdateCourseParams creates a new UpdateCourseParams 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 NewUpdateCourseParams() *UpdateCourseParams {
|
||||
return &UpdateCourseParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateCourseParamsWithTimeout creates a new UpdateCourseParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewUpdateCourseParamsWithTimeout(timeout time.Duration) *UpdateCourseParams {
|
||||
return &UpdateCourseParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateCourseParamsWithContext creates a new UpdateCourseParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewUpdateCourseParamsWithContext(ctx context.Context) *UpdateCourseParams {
|
||||
return &UpdateCourseParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateCourseParamsWithHTTPClient creates a new UpdateCourseParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewUpdateCourseParamsWithHTTPClient(client *http.Client) *UpdateCourseParams {
|
||||
return &UpdateCourseParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourseParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the update course operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type UpdateCourseParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Unique Record ID
|
||||
*/
|
||||
ID *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the update course params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *UpdateCourseParams) WithDefaults() *UpdateCourseParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the update course params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *UpdateCourseParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the update course params
|
||||
func (o *UpdateCourseParams) WithTimeout(timeout time.Duration) *UpdateCourseParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the update course params
|
||||
func (o *UpdateCourseParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the update course params
|
||||
func (o *UpdateCourseParams) WithContext(ctx context.Context) *UpdateCourseParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the update course params
|
||||
func (o *UpdateCourseParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the update course params
|
||||
func (o *UpdateCourseParams) WithHTTPClient(client *http.Client) *UpdateCourseParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the update course params
|
||||
func (o *UpdateCourseParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the update course params
|
||||
func (o *UpdateCourseParams) WithID(id *string) *UpdateCourseParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the update course params
|
||||
func (o *UpdateCourseParams) SetID(id *string) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *UpdateCourseParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.ID != nil {
|
||||
|
||||
// query param id
|
||||
var qrID string
|
||||
|
||||
if o.ID != nil {
|
||||
qrID = *o.ID
|
||||
}
|
||||
qID := qrID
|
||||
if qID != "" {
|
||||
|
||||
if err := r.SetQueryParam("id", qID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 courses
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// UpdateCourseReader is a Reader for the UpdateCourse structure.
|
||||
type UpdateCourseReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *UpdateCourseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewUpdateCourseOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateCourseOK creates a UpdateCourseOK with default headers values
|
||||
func NewUpdateCourseOK() *UpdateCourseOK {
|
||||
return &UpdateCourseOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourseOK describes a response with status code 200, with default header values.
|
||||
|
||||
OK
|
||||
*/
|
||||
type UpdateCourseOK struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update course o k response has a 2xx status code
|
||||
func (o *UpdateCourseOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update course o k response has a 3xx status code
|
||||
func (o *UpdateCourseOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update course o k response has a 4xx status code
|
||||
func (o *UpdateCourseOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update course o k response has a 5xx status code
|
||||
func (o *UpdateCourseOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update course o k response a status code equal to that given
|
||||
func (o *UpdateCourseOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the update course o k response
|
||||
func (o *UpdateCourseOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *UpdateCourseOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /courses][%d] updateCourseOK ", 200)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseOK) String() string {
|
||||
return fmt.Sprintf("[PUT /courses][%d] updateCourseOK ", 200)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -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 courses
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewUpdateCourseSectionsParams creates a new UpdateCourseSectionsParams 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 NewUpdateCourseSectionsParams() *UpdateCourseSectionsParams {
|
||||
return &UpdateCourseSectionsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateCourseSectionsParamsWithTimeout creates a new UpdateCourseSectionsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewUpdateCourseSectionsParamsWithTimeout(timeout time.Duration) *UpdateCourseSectionsParams {
|
||||
return &UpdateCourseSectionsParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateCourseSectionsParamsWithContext creates a new UpdateCourseSectionsParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewUpdateCourseSectionsParamsWithContext(ctx context.Context) *UpdateCourseSectionsParams {
|
||||
return &UpdateCourseSectionsParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateCourseSectionsParamsWithHTTPClient creates a new UpdateCourseSectionsParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewUpdateCourseSectionsParamsWithHTTPClient(client *http.Client) *UpdateCourseSectionsParams {
|
||||
return &UpdateCourseSectionsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourseSectionsParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the update course sections operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type UpdateCourseSectionsParams struct {
|
||||
|
||||
/* CoursesectionRequest.
|
||||
|
||||
An array of new CourseSection records
|
||||
*/
|
||||
CoursesectionRequest *members_models.CourseSectionRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the update course sections params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *UpdateCourseSectionsParams) WithDefaults() *UpdateCourseSectionsParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the update course sections params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *UpdateCourseSectionsParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the update course sections params
|
||||
func (o *UpdateCourseSectionsParams) WithTimeout(timeout time.Duration) *UpdateCourseSectionsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the update course sections params
|
||||
func (o *UpdateCourseSectionsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the update course sections params
|
||||
func (o *UpdateCourseSectionsParams) WithContext(ctx context.Context) *UpdateCourseSectionsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the update course sections params
|
||||
func (o *UpdateCourseSectionsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the update course sections params
|
||||
func (o *UpdateCourseSectionsParams) WithHTTPClient(client *http.Client) *UpdateCourseSectionsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the update course sections params
|
||||
func (o *UpdateCourseSectionsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithCoursesectionRequest adds the coursesectionRequest to the update course sections params
|
||||
func (o *UpdateCourseSectionsParams) WithCoursesectionRequest(coursesectionRequest *members_models.CourseSectionRequest) *UpdateCourseSectionsParams {
|
||||
o.SetCoursesectionRequest(coursesectionRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetCoursesectionRequest adds the coursesectionRequest to the update course sections params
|
||||
func (o *UpdateCourseSectionsParams) SetCoursesectionRequest(coursesectionRequest *members_models.CourseSectionRequest) {
|
||||
o.CoursesectionRequest = coursesectionRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *UpdateCourseSectionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.CoursesectionRequest != nil {
|
||||
if err := r.SetBodyParam(o.CoursesectionRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,486 @@
|
|||
// 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 courses
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// UpdateCourseSectionsReader is a Reader for the UpdateCourseSections structure.
|
||||
type UpdateCourseSectionsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *UpdateCourseSectionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewUpdateCourseSectionsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewUpdateCourseSectionsUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewUpdateCourseSectionsForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewUpdateCourseSectionsNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewUpdateCourseSectionsUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewUpdateCourseSectionsInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateCourseSectionsOK creates a UpdateCourseSectionsOK with default headers values
|
||||
func NewUpdateCourseSectionsOK() *UpdateCourseSectionsOK {
|
||||
return &UpdateCourseSectionsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourseSectionsOK describes a response with status code 200, with default header values.
|
||||
|
||||
CourseSection Response Object
|
||||
*/
|
||||
type UpdateCourseSectionsOK struct {
|
||||
Payload *members_models.CourseSectionResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update course sections o k response has a 2xx status code
|
||||
func (o *UpdateCourseSectionsOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update course sections o k response has a 3xx status code
|
||||
func (o *UpdateCourseSectionsOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update course sections o k response has a 4xx status code
|
||||
func (o *UpdateCourseSectionsOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update course sections o k response has a 5xx status code
|
||||
func (o *UpdateCourseSectionsOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update course sections o k response a status code equal to that given
|
||||
func (o *UpdateCourseSectionsOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the update course sections o k response
|
||||
func (o *UpdateCourseSectionsOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /coursesections][%d] updateCourseSectionsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsOK) String() string {
|
||||
return fmt.Sprintf("[PUT /coursesections][%d] updateCourseSectionsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsOK) GetPayload() *members_models.CourseSectionResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.CourseSectionResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewUpdateCourseSectionsUnauthorized creates a UpdateCourseSectionsUnauthorized with default headers values
|
||||
func NewUpdateCourseSectionsUnauthorized() *UpdateCourseSectionsUnauthorized {
|
||||
return &UpdateCourseSectionsUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourseSectionsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type UpdateCourseSectionsUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update course sections unauthorized response has a 2xx status code
|
||||
func (o *UpdateCourseSectionsUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update course sections unauthorized response has a 3xx status code
|
||||
func (o *UpdateCourseSectionsUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update course sections unauthorized response has a 4xx status code
|
||||
func (o *UpdateCourseSectionsUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update course sections unauthorized response has a 5xx status code
|
||||
func (o *UpdateCourseSectionsUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update course sections unauthorized response a status code equal to that given
|
||||
func (o *UpdateCourseSectionsUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the update course sections unauthorized response
|
||||
func (o *UpdateCourseSectionsUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[PUT /coursesections][%d] updateCourseSectionsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsUnauthorized) String() string {
|
||||
return fmt.Sprintf("[PUT /coursesections][%d] updateCourseSectionsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewUpdateCourseSectionsForbidden creates a UpdateCourseSectionsForbidden with default headers values
|
||||
func NewUpdateCourseSectionsForbidden() *UpdateCourseSectionsForbidden {
|
||||
return &UpdateCourseSectionsForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourseSectionsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type UpdateCourseSectionsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update course sections forbidden response has a 2xx status code
|
||||
func (o *UpdateCourseSectionsForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update course sections forbidden response has a 3xx status code
|
||||
func (o *UpdateCourseSectionsForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update course sections forbidden response has a 4xx status code
|
||||
func (o *UpdateCourseSectionsForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update course sections forbidden response has a 5xx status code
|
||||
func (o *UpdateCourseSectionsForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update course sections forbidden response a status code equal to that given
|
||||
func (o *UpdateCourseSectionsForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the update course sections forbidden response
|
||||
func (o *UpdateCourseSectionsForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsForbidden) Error() string {
|
||||
return fmt.Sprintf("[PUT /coursesections][%d] updateCourseSectionsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsForbidden) String() string {
|
||||
return fmt.Sprintf("[PUT /coursesections][%d] updateCourseSectionsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsForbidden) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewUpdateCourseSectionsNotFound creates a UpdateCourseSectionsNotFound with default headers values
|
||||
func NewUpdateCourseSectionsNotFound() *UpdateCourseSectionsNotFound {
|
||||
return &UpdateCourseSectionsNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourseSectionsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type UpdateCourseSectionsNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update course sections not found response has a 2xx status code
|
||||
func (o *UpdateCourseSectionsNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update course sections not found response has a 3xx status code
|
||||
func (o *UpdateCourseSectionsNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update course sections not found response has a 4xx status code
|
||||
func (o *UpdateCourseSectionsNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update course sections not found response has a 5xx status code
|
||||
func (o *UpdateCourseSectionsNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update course sections not found response a status code equal to that given
|
||||
func (o *UpdateCourseSectionsNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the update course sections not found response
|
||||
func (o *UpdateCourseSectionsNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsNotFound) Error() string {
|
||||
return fmt.Sprintf("[PUT /coursesections][%d] updateCourseSectionsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsNotFound) String() string {
|
||||
return fmt.Sprintf("[PUT /coursesections][%d] updateCourseSectionsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsNotFound) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewUpdateCourseSectionsUnprocessableEntity creates a UpdateCourseSectionsUnprocessableEntity with default headers values
|
||||
func NewUpdateCourseSectionsUnprocessableEntity() *UpdateCourseSectionsUnprocessableEntity {
|
||||
return &UpdateCourseSectionsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourseSectionsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type UpdateCourseSectionsUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update course sections unprocessable entity response has a 2xx status code
|
||||
func (o *UpdateCourseSectionsUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update course sections unprocessable entity response has a 3xx status code
|
||||
func (o *UpdateCourseSectionsUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update course sections unprocessable entity response has a 4xx status code
|
||||
func (o *UpdateCourseSectionsUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update course sections unprocessable entity response has a 5xx status code
|
||||
func (o *UpdateCourseSectionsUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update course sections unprocessable entity response a status code equal to that given
|
||||
func (o *UpdateCourseSectionsUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the update course sections unprocessable entity response
|
||||
func (o *UpdateCourseSectionsUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PUT /coursesections][%d] updateCourseSectionsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[PUT /coursesections][%d] updateCourseSectionsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewUpdateCourseSectionsInternalServerError creates a UpdateCourseSectionsInternalServerError with default headers values
|
||||
func NewUpdateCourseSectionsInternalServerError() *UpdateCourseSectionsInternalServerError {
|
||||
return &UpdateCourseSectionsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCourseSectionsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type UpdateCourseSectionsInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update course sections internal server error response has a 2xx status code
|
||||
func (o *UpdateCourseSectionsInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update course sections internal server error response has a 3xx status code
|
||||
func (o *UpdateCourseSectionsInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update course sections internal server error response has a 4xx status code
|
||||
func (o *UpdateCourseSectionsInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update course sections internal server error response has a 5xx status code
|
||||
func (o *UpdateCourseSectionsInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this update course sections internal server error response a status code equal to that given
|
||||
func (o *UpdateCourseSectionsInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the update course sections internal server error response
|
||||
func (o *UpdateCourseSectionsInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[PUT /coursesections][%d] updateCourseSectionsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[PUT /coursesections][%d] updateCourseSectionsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateCourseSectionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -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 courses
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewUpdateCoursesParams creates a new UpdateCoursesParams 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 NewUpdateCoursesParams() *UpdateCoursesParams {
|
||||
return &UpdateCoursesParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateCoursesParamsWithTimeout creates a new UpdateCoursesParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewUpdateCoursesParamsWithTimeout(timeout time.Duration) *UpdateCoursesParams {
|
||||
return &UpdateCoursesParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateCoursesParamsWithContext creates a new UpdateCoursesParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewUpdateCoursesParamsWithContext(ctx context.Context) *UpdateCoursesParams {
|
||||
return &UpdateCoursesParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateCoursesParamsWithHTTPClient creates a new UpdateCoursesParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewUpdateCoursesParamsWithHTTPClient(client *http.Client) *UpdateCoursesParams {
|
||||
return &UpdateCoursesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCoursesParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the update courses operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type UpdateCoursesParams struct {
|
||||
|
||||
/* CourseRequest.
|
||||
|
||||
An array of new Course records
|
||||
*/
|
||||
CourseRequest *members_models.CourseRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the update courses params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *UpdateCoursesParams) WithDefaults() *UpdateCoursesParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the update courses params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *UpdateCoursesParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the update courses params
|
||||
func (o *UpdateCoursesParams) WithTimeout(timeout time.Duration) *UpdateCoursesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the update courses params
|
||||
func (o *UpdateCoursesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the update courses params
|
||||
func (o *UpdateCoursesParams) WithContext(ctx context.Context) *UpdateCoursesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the update courses params
|
||||
func (o *UpdateCoursesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the update courses params
|
||||
func (o *UpdateCoursesParams) WithHTTPClient(client *http.Client) *UpdateCoursesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the update courses params
|
||||
func (o *UpdateCoursesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithCourseRequest adds the courseRequest to the update courses params
|
||||
func (o *UpdateCoursesParams) WithCourseRequest(courseRequest *members_models.CourseRequest) *UpdateCoursesParams {
|
||||
o.SetCourseRequest(courseRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetCourseRequest adds the courseRequest to the update courses params
|
||||
func (o *UpdateCoursesParams) SetCourseRequest(courseRequest *members_models.CourseRequest) {
|
||||
o.CourseRequest = courseRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *UpdateCoursesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.CourseRequest != nil {
|
||||
if err := r.SetBodyParam(o.CourseRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,486 @@
|
|||
// 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 courses
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// UpdateCoursesReader is a Reader for the UpdateCourses structure.
|
||||
type UpdateCoursesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *UpdateCoursesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewUpdateCoursesOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewUpdateCoursesUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewUpdateCoursesForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewUpdateCoursesNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewUpdateCoursesUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewUpdateCoursesInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateCoursesOK creates a UpdateCoursesOK with default headers values
|
||||
func NewUpdateCoursesOK() *UpdateCoursesOK {
|
||||
return &UpdateCoursesOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCoursesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Course Response Object
|
||||
*/
|
||||
type UpdateCoursesOK struct {
|
||||
Payload *members_models.CourseResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update courses o k response has a 2xx status code
|
||||
func (o *UpdateCoursesOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update courses o k response has a 3xx status code
|
||||
func (o *UpdateCoursesOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update courses o k response has a 4xx status code
|
||||
func (o *UpdateCoursesOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update courses o k response has a 5xx status code
|
||||
func (o *UpdateCoursesOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update courses o k response a status code equal to that given
|
||||
func (o *UpdateCoursesOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the update courses o k response
|
||||
func (o *UpdateCoursesOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /courses][%d] updateCoursesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesOK) String() string {
|
||||
return fmt.Sprintf("[PUT /courses][%d] updateCoursesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesOK) GetPayload() *members_models.CourseResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.CourseResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewUpdateCoursesUnauthorized creates a UpdateCoursesUnauthorized with default headers values
|
||||
func NewUpdateCoursesUnauthorized() *UpdateCoursesUnauthorized {
|
||||
return &UpdateCoursesUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCoursesUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type UpdateCoursesUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update courses unauthorized response has a 2xx status code
|
||||
func (o *UpdateCoursesUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update courses unauthorized response has a 3xx status code
|
||||
func (o *UpdateCoursesUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update courses unauthorized response has a 4xx status code
|
||||
func (o *UpdateCoursesUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update courses unauthorized response has a 5xx status code
|
||||
func (o *UpdateCoursesUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update courses unauthorized response a status code equal to that given
|
||||
func (o *UpdateCoursesUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the update courses unauthorized response
|
||||
func (o *UpdateCoursesUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[PUT /courses][%d] updateCoursesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesUnauthorized) String() string {
|
||||
return fmt.Sprintf("[PUT /courses][%d] updateCoursesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewUpdateCoursesForbidden creates a UpdateCoursesForbidden with default headers values
|
||||
func NewUpdateCoursesForbidden() *UpdateCoursesForbidden {
|
||||
return &UpdateCoursesForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCoursesForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type UpdateCoursesForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update courses forbidden response has a 2xx status code
|
||||
func (o *UpdateCoursesForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update courses forbidden response has a 3xx status code
|
||||
func (o *UpdateCoursesForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update courses forbidden response has a 4xx status code
|
||||
func (o *UpdateCoursesForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update courses forbidden response has a 5xx status code
|
||||
func (o *UpdateCoursesForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update courses forbidden response a status code equal to that given
|
||||
func (o *UpdateCoursesForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the update courses forbidden response
|
||||
func (o *UpdateCoursesForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesForbidden) Error() string {
|
||||
return fmt.Sprintf("[PUT /courses][%d] updateCoursesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesForbidden) String() string {
|
||||
return fmt.Sprintf("[PUT /courses][%d] updateCoursesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesForbidden) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewUpdateCoursesNotFound creates a UpdateCoursesNotFound with default headers values
|
||||
func NewUpdateCoursesNotFound() *UpdateCoursesNotFound {
|
||||
return &UpdateCoursesNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCoursesNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type UpdateCoursesNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update courses not found response has a 2xx status code
|
||||
func (o *UpdateCoursesNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update courses not found response has a 3xx status code
|
||||
func (o *UpdateCoursesNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update courses not found response has a 4xx status code
|
||||
func (o *UpdateCoursesNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update courses not found response has a 5xx status code
|
||||
func (o *UpdateCoursesNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update courses not found response a status code equal to that given
|
||||
func (o *UpdateCoursesNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the update courses not found response
|
||||
func (o *UpdateCoursesNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesNotFound) Error() string {
|
||||
return fmt.Sprintf("[PUT /courses][%d] updateCoursesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesNotFound) String() string {
|
||||
return fmt.Sprintf("[PUT /courses][%d] updateCoursesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesNotFound) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewUpdateCoursesUnprocessableEntity creates a UpdateCoursesUnprocessableEntity with default headers values
|
||||
func NewUpdateCoursesUnprocessableEntity() *UpdateCoursesUnprocessableEntity {
|
||||
return &UpdateCoursesUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCoursesUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type UpdateCoursesUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update courses unprocessable entity response has a 2xx status code
|
||||
func (o *UpdateCoursesUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update courses unprocessable entity response has a 3xx status code
|
||||
func (o *UpdateCoursesUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update courses unprocessable entity response has a 4xx status code
|
||||
func (o *UpdateCoursesUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update courses unprocessable entity response has a 5xx status code
|
||||
func (o *UpdateCoursesUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update courses unprocessable entity response a status code equal to that given
|
||||
func (o *UpdateCoursesUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the update courses unprocessable entity response
|
||||
func (o *UpdateCoursesUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PUT /courses][%d] updateCoursesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[PUT /courses][%d] updateCoursesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewUpdateCoursesInternalServerError creates a UpdateCoursesInternalServerError with default headers values
|
||||
func NewUpdateCoursesInternalServerError() *UpdateCoursesInternalServerError {
|
||||
return &UpdateCoursesInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCoursesInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type UpdateCoursesInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update courses internal server error response has a 2xx status code
|
||||
func (o *UpdateCoursesInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update courses internal server error response has a 3xx status code
|
||||
func (o *UpdateCoursesInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update courses internal server error response has a 4xx status code
|
||||
func (o *UpdateCoursesInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update courses internal server error response has a 5xx status code
|
||||
func (o *UpdateCoursesInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this update courses internal server error response a status code equal to that given
|
||||
func (o *UpdateCoursesInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the update courses internal server error response
|
||||
func (o *UpdateCoursesInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[PUT /courses][%d] updateCoursesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesInternalServerError) String() string {
|
||||
return fmt.Sprintf("[PUT /courses][%d] updateCoursesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateCoursesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -79,8 +79,6 @@ GetDatabasesOK describes a response with status code 200, with default header va
|
|||
Response with Database objects
|
||||
*/
|
||||
type GetDatabasesOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.DatabaseResponse
|
||||
}
|
||||
|
||||
|
|
@ -128,13 +126,6 @@ func (o *GetDatabasesOK) GetPayload() *members_models.DatabaseResponse {
|
|||
|
||||
func (o *GetDatabasesOK) 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(members_models.DatabaseResponse)
|
||||
|
||||
// response payload
|
||||
|
|
@ -301,8 +292,6 @@ GetDatabasesNotFound describes a response with status code 404, with default hea
|
|||
Resource was not found
|
||||
*/
|
||||
type GetDatabasesNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
|
|
@ -350,13 +339,6 @@ func (o *GetDatabasesNotFound) GetPayload() *members_models.Error {
|
|||
|
||||
func (o *GetDatabasesNotFound) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
|
|
@ -446,8 +428,6 @@ GetDatabasesInternalServerError describes a response with status code 500, with
|
|||
Server Internal Error
|
||||
*/
|
||||
type GetDatabasesInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
|
|
@ -495,13 +475,6 @@ func (o *GetDatabasesInternalServerError) GetPayload() *members_models.Error {
|
|||
|
||||
func (o *GetDatabasesInternalServerError) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
|
|
|
|||
|
|
@ -79,8 +79,6 @@ PostDatabasesOK describes a response with status code 200, with default header v
|
|||
Response with Database objects
|
||||
*/
|
||||
type PostDatabasesOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.DatabaseResponse
|
||||
}
|
||||
|
||||
|
|
@ -128,13 +126,6 @@ func (o *PostDatabasesOK) GetPayload() *members_models.DatabaseResponse {
|
|||
|
||||
func (o *PostDatabasesOK) 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(members_models.DatabaseResponse)
|
||||
|
||||
// response payload
|
||||
|
|
@ -301,8 +292,6 @@ PostDatabasesNotFound describes a response with status code 404, with default he
|
|||
Resource was not found
|
||||
*/
|
||||
type PostDatabasesNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
|
|
@ -350,13 +339,6 @@ func (o *PostDatabasesNotFound) GetPayload() *members_models.Error {
|
|||
|
||||
func (o *PostDatabasesNotFound) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
|
|
@ -446,8 +428,6 @@ PostDatabasesInternalServerError describes a response with status code 500, with
|
|||
Server Internal Error
|
||||
*/
|
||||
type PostDatabasesInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
|
|
@ -495,13 +475,6 @@ func (o *PostDatabasesInternalServerError) GetPayload() *members_models.Error {
|
|||
|
||||
func (o *PostDatabasesInternalServerError) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
|
|
|
|||
|
|
@ -79,8 +79,6 @@ PutDatabasesOK describes a response with status code 200, with default header va
|
|||
Response with Database objects
|
||||
*/
|
||||
type PutDatabasesOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.DatabaseResponse
|
||||
}
|
||||
|
||||
|
|
@ -128,13 +126,6 @@ func (o *PutDatabasesOK) GetPayload() *members_models.DatabaseResponse {
|
|||
|
||||
func (o *PutDatabasesOK) 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(members_models.DatabaseResponse)
|
||||
|
||||
// response payload
|
||||
|
|
@ -301,8 +292,6 @@ PutDatabasesNotFound describes a response with status code 404, with default hea
|
|||
Resource was not found
|
||||
*/
|
||||
type PutDatabasesNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
|
|
@ -350,13 +339,6 @@ func (o *PutDatabasesNotFound) GetPayload() *members_models.Error {
|
|||
|
||||
func (o *PutDatabasesNotFound) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
|
|
@ -446,8 +428,6 @@ PutDatabasesInternalServerError describes a response with status code 500, with
|
|||
Server Internal Error
|
||||
*/
|
||||
type PutDatabasesInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
|
|
@ -495,13 +475,6 @@ func (o *PutDatabasesInternalServerError) GetPayload() *members_models.Error {
|
|||
|
||||
func (o *PutDatabasesInternalServerError) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
|
|
|
|||
|
|
@ -36,6 +36,10 @@ type ClientOption func(*runtime.ClientOperation)
|
|||
type ClientService interface {
|
||||
GetEmailMessages(params *GetEmailMessagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetEmailMessagesOK, error)
|
||||
|
||||
GetOutgoingEmailMessages(params *GetOutgoingEmailMessagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOutgoingEmailMessagesOK, error)
|
||||
|
||||
PostEmailMessages(params *PostEmailMessagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostEmailMessagesOK, error)
|
||||
|
||||
PostOutgoingEmailMessages(params *PostOutgoingEmailMessagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostOutgoingEmailMessagesOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
|
|
@ -54,7 +58,7 @@ func (a *Client) GetEmailMessages(params *GetEmailMessagesParams, authInfo runti
|
|||
op := &runtime.ClientOperation{
|
||||
ID: "getEmailMessages",
|
||||
Method: "GET",
|
||||
PathPattern: "/emails",
|
||||
PathPattern: "/emailmessages",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
|
|
@ -82,6 +86,88 @@ func (a *Client) GetEmailMessages(params *GetEmailMessagesParams, authInfo runti
|
|||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetOutgoingEmailMessages gets email messages from data store
|
||||
|
||||
Retrieves email messages from workflow storage
|
||||
*/
|
||||
func (a *Client) GetOutgoingEmailMessages(params *GetOutgoingEmailMessagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOutgoingEmailMessagesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetOutgoingEmailMessagesParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getOutgoingEmailMessages",
|
||||
Method: "GET",
|
||||
PathPattern: "/outgoingemailmessages",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetOutgoingEmailMessagesReader{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.(*GetOutgoingEmailMessagesOK)
|
||||
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 getOutgoingEmailMessages: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostEmailMessages adds new email messages to the outgoing queue
|
||||
|
||||
Insert new email messages into workflow storage
|
||||
*/
|
||||
func (a *Client) PostEmailMessages(params *PostEmailMessagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostEmailMessagesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostEmailMessagesParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postEmailMessages",
|
||||
Method: "POST",
|
||||
PathPattern: "/emailmessages",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostEmailMessagesReader{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.(*PostEmailMessagesOK)
|
||||
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 postEmailMessages: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostOutgoingEmailMessages adds new email messages to the outgoing queue
|
||||
|
||||
|
|
@ -95,7 +181,7 @@ func (a *Client) PostOutgoingEmailMessages(params *PostOutgoingEmailMessagesPara
|
|||
op := &runtime.ClientOperation{
|
||||
ID: "postOutgoingEmailMessages",
|
||||
Method: "POST",
|
||||
PathPattern: "/emails",
|
||||
PathPattern: "/outgoingemailmessages",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
|
|
|
|||
|
|
@ -79,8 +79,6 @@ GetEmailMessagesOK describes a response with status code 200, with default heade
|
|||
Array of Email Messages
|
||||
*/
|
||||
type GetEmailMessagesOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.EmailMessagesResponse
|
||||
}
|
||||
|
||||
|
|
@ -115,11 +113,11 @@ func (o *GetEmailMessagesOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetEmailMessagesOK) Error() string {
|
||||
return fmt.Sprintf("[GET /emails][%d] getEmailMessagesOK %+v", 200, o.Payload)
|
||||
return fmt.Sprintf("[GET /emailmessages][%d] getEmailMessagesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEmailMessagesOK) String() string {
|
||||
return fmt.Sprintf("[GET /emails][%d] getEmailMessagesOK %+v", 200, o.Payload)
|
||||
return fmt.Sprintf("[GET /emailmessages][%d] getEmailMessagesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEmailMessagesOK) GetPayload() *members_models.EmailMessagesResponse {
|
||||
|
|
@ -128,13 +126,6 @@ func (o *GetEmailMessagesOK) GetPayload() *members_models.EmailMessagesResponse
|
|||
|
||||
func (o *GetEmailMessagesOK) 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(members_models.EmailMessagesResponse)
|
||||
|
||||
// response payload
|
||||
|
|
@ -190,11 +181,11 @@ func (o *GetEmailMessagesUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetEmailMessagesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /emails][%d] getEmailMessagesUnauthorized %+v", 401, o.Payload)
|
||||
return fmt.Sprintf("[GET /emailmessages][%d] getEmailMessagesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEmailMessagesUnauthorized) String() string {
|
||||
return fmt.Sprintf("[GET /emails][%d] getEmailMessagesUnauthorized %+v", 401, o.Payload)
|
||||
return fmt.Sprintf("[GET /emailmessages][%d] getEmailMessagesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEmailMessagesUnauthorized) GetPayload() *members_models.Error {
|
||||
|
|
@ -260,11 +251,11 @@ func (o *GetEmailMessagesForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetEmailMessagesForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /emails][%d] getEmailMessagesForbidden %+v", 403, o.Payload)
|
||||
return fmt.Sprintf("[GET /emailmessages][%d] getEmailMessagesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEmailMessagesForbidden) String() string {
|
||||
return fmt.Sprintf("[GET /emails][%d] getEmailMessagesForbidden %+v", 403, o.Payload)
|
||||
return fmt.Sprintf("[GET /emailmessages][%d] getEmailMessagesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEmailMessagesForbidden) GetPayload() *members_models.Error {
|
||||
|
|
@ -301,8 +292,6 @@ GetEmailMessagesNotFound describes a response with status code 404, with default
|
|||
Resource was not found
|
||||
*/
|
||||
type GetEmailMessagesNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
|
|
@ -337,11 +326,11 @@ func (o *GetEmailMessagesNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetEmailMessagesNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /emails][%d] getEmailMessagesNotFound %+v", 404, o.Payload)
|
||||
return fmt.Sprintf("[GET /emailmessages][%d] getEmailMessagesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEmailMessagesNotFound) String() string {
|
||||
return fmt.Sprintf("[GET /emails][%d] getEmailMessagesNotFound %+v", 404, o.Payload)
|
||||
return fmt.Sprintf("[GET /emailmessages][%d] getEmailMessagesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEmailMessagesNotFound) GetPayload() *members_models.Error {
|
||||
|
|
@ -350,13 +339,6 @@ func (o *GetEmailMessagesNotFound) GetPayload() *members_models.Error {
|
|||
|
||||
func (o *GetEmailMessagesNotFound) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
|
|
@ -412,11 +394,11 @@ func (o *GetEmailMessagesUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetEmailMessagesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /emails][%d] getEmailMessagesUnprocessableEntity %+v", 422, o.Payload)
|
||||
return fmt.Sprintf("[GET /emailmessages][%d] getEmailMessagesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEmailMessagesUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[GET /emails][%d] getEmailMessagesUnprocessableEntity %+v", 422, o.Payload)
|
||||
return fmt.Sprintf("[GET /emailmessages][%d] getEmailMessagesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEmailMessagesUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
|
|
@ -446,8 +428,6 @@ GetEmailMessagesInternalServerError describes a response with status code 500, w
|
|||
Server Internal Error
|
||||
*/
|
||||
type GetEmailMessagesInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
|
|
@ -482,11 +462,11 @@ func (o *GetEmailMessagesInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetEmailMessagesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /emails][%d] getEmailMessagesInternalServerError %+v", 500, o.Payload)
|
||||
return fmt.Sprintf("[GET /emailmessages][%d] getEmailMessagesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEmailMessagesInternalServerError) String() string {
|
||||
return fmt.Sprintf("[GET /emails][%d] getEmailMessagesInternalServerError %+v", 500, o.Payload)
|
||||
return fmt.Sprintf("[GET /emailmessages][%d] getEmailMessagesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEmailMessagesInternalServerError) GetPayload() *members_models.Error {
|
||||
|
|
@ -495,13 +475,6 @@ func (o *GetEmailMessagesInternalServerError) GetPayload() *members_models.Error
|
|||
|
||||
func (o *GetEmailMessagesInternalServerError) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
|
|
|
|||
|
|
@ -0,0 +1,240 @@
|
|||
// 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 emails
|
||||
|
||||
// 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"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewGetOutgoingEmailMessagesParams creates a new GetOutgoingEmailMessagesParams 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 NewGetOutgoingEmailMessagesParams() *GetOutgoingEmailMessagesParams {
|
||||
return &GetOutgoingEmailMessagesParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetOutgoingEmailMessagesParamsWithTimeout creates a new GetOutgoingEmailMessagesParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetOutgoingEmailMessagesParamsWithTimeout(timeout time.Duration) *GetOutgoingEmailMessagesParams {
|
||||
return &GetOutgoingEmailMessagesParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetOutgoingEmailMessagesParamsWithContext creates a new GetOutgoingEmailMessagesParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetOutgoingEmailMessagesParamsWithContext(ctx context.Context) *GetOutgoingEmailMessagesParams {
|
||||
return &GetOutgoingEmailMessagesParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetOutgoingEmailMessagesParamsWithHTTPClient creates a new GetOutgoingEmailMessagesParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetOutgoingEmailMessagesParamsWithHTTPClient(client *http.Client) *GetOutgoingEmailMessagesParams {
|
||||
return &GetOutgoingEmailMessagesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetOutgoingEmailMessagesParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get outgoing email messages operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetOutgoingEmailMessagesParams struct {
|
||||
|
||||
/* EmailMessageID.
|
||||
|
||||
Email Message ID
|
||||
*/
|
||||
EmailMessageID *string
|
||||
|
||||
/* Limit.
|
||||
|
||||
How many objects to return at one time
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
Limit *int64
|
||||
|
||||
/* Offset.
|
||||
|
||||
How many objects to skip?
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
Offset *int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get outgoing email messages params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetOutgoingEmailMessagesParams) WithDefaults() *GetOutgoingEmailMessagesParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get outgoing email messages params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetOutgoingEmailMessagesParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get outgoing email messages params
|
||||
func (o *GetOutgoingEmailMessagesParams) WithTimeout(timeout time.Duration) *GetOutgoingEmailMessagesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get outgoing email messages params
|
||||
func (o *GetOutgoingEmailMessagesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get outgoing email messages params
|
||||
func (o *GetOutgoingEmailMessagesParams) WithContext(ctx context.Context) *GetOutgoingEmailMessagesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get outgoing email messages params
|
||||
func (o *GetOutgoingEmailMessagesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get outgoing email messages params
|
||||
func (o *GetOutgoingEmailMessagesParams) WithHTTPClient(client *http.Client) *GetOutgoingEmailMessagesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get outgoing email messages params
|
||||
func (o *GetOutgoingEmailMessagesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithEmailMessageID adds the emailMessageID to the get outgoing email messages params
|
||||
func (o *GetOutgoingEmailMessagesParams) WithEmailMessageID(emailMessageID *string) *GetOutgoingEmailMessagesParams {
|
||||
o.SetEmailMessageID(emailMessageID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetEmailMessageID adds the emailMessageId to the get outgoing email messages params
|
||||
func (o *GetOutgoingEmailMessagesParams) SetEmailMessageID(emailMessageID *string) {
|
||||
o.EmailMessageID = emailMessageID
|
||||
}
|
||||
|
||||
// WithLimit adds the limit to the get outgoing email messages params
|
||||
func (o *GetOutgoingEmailMessagesParams) WithLimit(limit *int64) *GetOutgoingEmailMessagesParams {
|
||||
o.SetLimit(limit)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLimit adds the limit to the get outgoing email messages params
|
||||
func (o *GetOutgoingEmailMessagesParams) SetLimit(limit *int64) {
|
||||
o.Limit = limit
|
||||
}
|
||||
|
||||
// WithOffset adds the offset to the get outgoing email messages params
|
||||
func (o *GetOutgoingEmailMessagesParams) WithOffset(offset *int64) *GetOutgoingEmailMessagesParams {
|
||||
o.SetOffset(offset)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOffset adds the offset to the get outgoing email messages params
|
||||
func (o *GetOutgoingEmailMessagesParams) SetOffset(offset *int64) {
|
||||
o.Offset = offset
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetOutgoingEmailMessagesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.EmailMessageID != nil {
|
||||
|
||||
// query param emailMessageId
|
||||
var qrEmailMessageID string
|
||||
|
||||
if o.EmailMessageID != nil {
|
||||
qrEmailMessageID = *o.EmailMessageID
|
||||
}
|
||||
qEmailMessageID := qrEmailMessageID
|
||||
if qEmailMessageID != "" {
|
||||
|
||||
if err := r.SetQueryParam("emailMessageId", qEmailMessageID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if o.Limit != nil {
|
||||
|
||||
// query param limit
|
||||
var qrLimit int64
|
||||
|
||||
if o.Limit != nil {
|
||||
qrLimit = *o.Limit
|
||||
}
|
||||
qLimit := swag.FormatInt64(qrLimit)
|
||||
if qLimit != "" {
|
||||
|
||||
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if o.Offset != nil {
|
||||
|
||||
// query param offset
|
||||
var qrOffset int64
|
||||
|
||||
if o.Offset != nil {
|
||||
qrOffset = *o.Offset
|
||||
}
|
||||
qOffset := swag.FormatInt64(qrOffset)
|
||||
if qOffset != "" {
|
||||
|
||||
if err := r.SetQueryParam("offset", qOffset); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,486 @@
|
|||
// 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 emails
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// GetOutgoingEmailMessagesReader is a Reader for the GetOutgoingEmailMessages structure.
|
||||
type GetOutgoingEmailMessagesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetOutgoingEmailMessagesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetOutgoingEmailMessagesOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetOutgoingEmailMessagesUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetOutgoingEmailMessagesForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetOutgoingEmailMessagesNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewGetOutgoingEmailMessagesUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetOutgoingEmailMessagesInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetOutgoingEmailMessagesOK creates a GetOutgoingEmailMessagesOK with default headers values
|
||||
func NewGetOutgoingEmailMessagesOK() *GetOutgoingEmailMessagesOK {
|
||||
return &GetOutgoingEmailMessagesOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetOutgoingEmailMessagesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Array of Outgoing Email Messages
|
||||
*/
|
||||
type GetOutgoingEmailMessagesOK struct {
|
||||
Payload *members_models.OutgoingEmailMessagesResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get outgoing email messages o k response has a 2xx status code
|
||||
func (o *GetOutgoingEmailMessagesOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get outgoing email messages o k response has a 3xx status code
|
||||
func (o *GetOutgoingEmailMessagesOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get outgoing email messages o k response has a 4xx status code
|
||||
func (o *GetOutgoingEmailMessagesOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get outgoing email messages o k response has a 5xx status code
|
||||
func (o *GetOutgoingEmailMessagesOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get outgoing email messages o k response a status code equal to that given
|
||||
func (o *GetOutgoingEmailMessagesOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the get outgoing email messages o k response
|
||||
func (o *GetOutgoingEmailMessagesOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesOK) Error() string {
|
||||
return fmt.Sprintf("[GET /outgoingemailmessages][%d] getOutgoingEmailMessagesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesOK) String() string {
|
||||
return fmt.Sprintf("[GET /outgoingemailmessages][%d] getOutgoingEmailMessagesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesOK) GetPayload() *members_models.OutgoingEmailMessagesResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.OutgoingEmailMessagesResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetOutgoingEmailMessagesUnauthorized creates a GetOutgoingEmailMessagesUnauthorized with default headers values
|
||||
func NewGetOutgoingEmailMessagesUnauthorized() *GetOutgoingEmailMessagesUnauthorized {
|
||||
return &GetOutgoingEmailMessagesUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetOutgoingEmailMessagesUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetOutgoingEmailMessagesUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get outgoing email messages unauthorized response has a 2xx status code
|
||||
func (o *GetOutgoingEmailMessagesUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get outgoing email messages unauthorized response has a 3xx status code
|
||||
func (o *GetOutgoingEmailMessagesUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get outgoing email messages unauthorized response has a 4xx status code
|
||||
func (o *GetOutgoingEmailMessagesUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get outgoing email messages unauthorized response has a 5xx status code
|
||||
func (o *GetOutgoingEmailMessagesUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get outgoing email messages unauthorized response a status code equal to that given
|
||||
func (o *GetOutgoingEmailMessagesUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the get outgoing email messages unauthorized response
|
||||
func (o *GetOutgoingEmailMessagesUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /outgoingemailmessages][%d] getOutgoingEmailMessagesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesUnauthorized) String() string {
|
||||
return fmt.Sprintf("[GET /outgoingemailmessages][%d] getOutgoingEmailMessagesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetOutgoingEmailMessagesForbidden creates a GetOutgoingEmailMessagesForbidden with default headers values
|
||||
func NewGetOutgoingEmailMessagesForbidden() *GetOutgoingEmailMessagesForbidden {
|
||||
return &GetOutgoingEmailMessagesForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetOutgoingEmailMessagesForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetOutgoingEmailMessagesForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get outgoing email messages forbidden response has a 2xx status code
|
||||
func (o *GetOutgoingEmailMessagesForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get outgoing email messages forbidden response has a 3xx status code
|
||||
func (o *GetOutgoingEmailMessagesForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get outgoing email messages forbidden response has a 4xx status code
|
||||
func (o *GetOutgoingEmailMessagesForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get outgoing email messages forbidden response has a 5xx status code
|
||||
func (o *GetOutgoingEmailMessagesForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get outgoing email messages forbidden response a status code equal to that given
|
||||
func (o *GetOutgoingEmailMessagesForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the get outgoing email messages forbidden response
|
||||
func (o *GetOutgoingEmailMessagesForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /outgoingemailmessages][%d] getOutgoingEmailMessagesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesForbidden) String() string {
|
||||
return fmt.Sprintf("[GET /outgoingemailmessages][%d] getOutgoingEmailMessagesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesForbidden) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetOutgoingEmailMessagesNotFound creates a GetOutgoingEmailMessagesNotFound with default headers values
|
||||
func NewGetOutgoingEmailMessagesNotFound() *GetOutgoingEmailMessagesNotFound {
|
||||
return &GetOutgoingEmailMessagesNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetOutgoingEmailMessagesNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetOutgoingEmailMessagesNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get outgoing email messages not found response has a 2xx status code
|
||||
func (o *GetOutgoingEmailMessagesNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get outgoing email messages not found response has a 3xx status code
|
||||
func (o *GetOutgoingEmailMessagesNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get outgoing email messages not found response has a 4xx status code
|
||||
func (o *GetOutgoingEmailMessagesNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get outgoing email messages not found response has a 5xx status code
|
||||
func (o *GetOutgoingEmailMessagesNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get outgoing email messages not found response a status code equal to that given
|
||||
func (o *GetOutgoingEmailMessagesNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the get outgoing email messages not found response
|
||||
func (o *GetOutgoingEmailMessagesNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /outgoingemailmessages][%d] getOutgoingEmailMessagesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesNotFound) String() string {
|
||||
return fmt.Sprintf("[GET /outgoingemailmessages][%d] getOutgoingEmailMessagesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesNotFound) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetOutgoingEmailMessagesUnprocessableEntity creates a GetOutgoingEmailMessagesUnprocessableEntity with default headers values
|
||||
func NewGetOutgoingEmailMessagesUnprocessableEntity() *GetOutgoingEmailMessagesUnprocessableEntity {
|
||||
return &GetOutgoingEmailMessagesUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetOutgoingEmailMessagesUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type GetOutgoingEmailMessagesUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get outgoing email messages unprocessable entity response has a 2xx status code
|
||||
func (o *GetOutgoingEmailMessagesUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get outgoing email messages unprocessable entity response has a 3xx status code
|
||||
func (o *GetOutgoingEmailMessagesUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get outgoing email messages unprocessable entity response has a 4xx status code
|
||||
func (o *GetOutgoingEmailMessagesUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get outgoing email messages unprocessable entity response has a 5xx status code
|
||||
func (o *GetOutgoingEmailMessagesUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get outgoing email messages unprocessable entity response a status code equal to that given
|
||||
func (o *GetOutgoingEmailMessagesUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the get outgoing email messages unprocessable entity response
|
||||
func (o *GetOutgoingEmailMessagesUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /outgoingemailmessages][%d] getOutgoingEmailMessagesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[GET /outgoingemailmessages][%d] getOutgoingEmailMessagesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetOutgoingEmailMessagesInternalServerError creates a GetOutgoingEmailMessagesInternalServerError with default headers values
|
||||
func NewGetOutgoingEmailMessagesInternalServerError() *GetOutgoingEmailMessagesInternalServerError {
|
||||
return &GetOutgoingEmailMessagesInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetOutgoingEmailMessagesInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetOutgoingEmailMessagesInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get outgoing email messages internal server error response has a 2xx status code
|
||||
func (o *GetOutgoingEmailMessagesInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get outgoing email messages internal server error response has a 3xx status code
|
||||
func (o *GetOutgoingEmailMessagesInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get outgoing email messages internal server error response has a 4xx status code
|
||||
func (o *GetOutgoingEmailMessagesInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get outgoing email messages internal server error response has a 5xx status code
|
||||
func (o *GetOutgoingEmailMessagesInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this get outgoing email messages internal server error response a status code equal to that given
|
||||
func (o *GetOutgoingEmailMessagesInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the get outgoing email messages internal server error response
|
||||
func (o *GetOutgoingEmailMessagesInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /outgoingemailmessages][%d] getOutgoingEmailMessagesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesInternalServerError) String() string {
|
||||
return fmt.Sprintf("[GET /outgoingemailmessages][%d] getOutgoingEmailMessagesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetOutgoingEmailMessagesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -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 emails
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewPostEmailMessagesParams creates a new PostEmailMessagesParams 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 NewPostEmailMessagesParams() *PostEmailMessagesParams {
|
||||
return &PostEmailMessagesParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostEmailMessagesParamsWithTimeout creates a new PostEmailMessagesParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostEmailMessagesParamsWithTimeout(timeout time.Duration) *PostEmailMessagesParams {
|
||||
return &PostEmailMessagesParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostEmailMessagesParamsWithContext creates a new PostEmailMessagesParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostEmailMessagesParamsWithContext(ctx context.Context) *PostEmailMessagesParams {
|
||||
return &PostEmailMessagesParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostEmailMessagesParamsWithHTTPClient creates a new PostEmailMessagesParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostEmailMessagesParamsWithHTTPClient(client *http.Client) *PostEmailMessagesParams {
|
||||
return &PostEmailMessagesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostEmailMessagesParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post email messages operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostEmailMessagesParams struct {
|
||||
|
||||
/* EmailMessageRequest.
|
||||
|
||||
An array of Email Message records
|
||||
*/
|
||||
EmailMessageRequest *members_models.EmailMessageRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post email messages params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostEmailMessagesParams) WithDefaults() *PostEmailMessagesParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post email messages params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostEmailMessagesParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post email messages params
|
||||
func (o *PostEmailMessagesParams) WithTimeout(timeout time.Duration) *PostEmailMessagesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post email messages params
|
||||
func (o *PostEmailMessagesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post email messages params
|
||||
func (o *PostEmailMessagesParams) WithContext(ctx context.Context) *PostEmailMessagesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post email messages params
|
||||
func (o *PostEmailMessagesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post email messages params
|
||||
func (o *PostEmailMessagesParams) WithHTTPClient(client *http.Client) *PostEmailMessagesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post email messages params
|
||||
func (o *PostEmailMessagesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithEmailMessageRequest adds the emailMessageRequest to the post email messages params
|
||||
func (o *PostEmailMessagesParams) WithEmailMessageRequest(emailMessageRequest *members_models.EmailMessageRequest) *PostEmailMessagesParams {
|
||||
o.SetEmailMessageRequest(emailMessageRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetEmailMessageRequest adds the emailMessageRequest to the post email messages params
|
||||
func (o *PostEmailMessagesParams) SetEmailMessageRequest(emailMessageRequest *members_models.EmailMessageRequest) {
|
||||
o.EmailMessageRequest = emailMessageRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostEmailMessagesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.EmailMessageRequest != nil {
|
||||
if err := r.SetBodyParam(o.EmailMessageRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,486 @@
|
|||
// 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 emails
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// PostEmailMessagesReader is a Reader for the PostEmailMessages structure.
|
||||
type PostEmailMessagesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostEmailMessagesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostEmailMessagesOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPostEmailMessagesUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPostEmailMessagesForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPostEmailMessagesNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPostEmailMessagesUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPostEmailMessagesInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostEmailMessagesOK creates a PostEmailMessagesOK with default headers values
|
||||
func NewPostEmailMessagesOK() *PostEmailMessagesOK {
|
||||
return &PostEmailMessagesOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostEmailMessagesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Array of Email Messages
|
||||
*/
|
||||
type PostEmailMessagesOK struct {
|
||||
Payload *members_models.EmailMessagesResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post email messages o k response has a 2xx status code
|
||||
func (o *PostEmailMessagesOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post email messages o k response has a 3xx status code
|
||||
func (o *PostEmailMessagesOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post email messages o k response has a 4xx status code
|
||||
func (o *PostEmailMessagesOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post email messages o k response has a 5xx status code
|
||||
func (o *PostEmailMessagesOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post email messages o k response a status code equal to that given
|
||||
func (o *PostEmailMessagesOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the post email messages o k response
|
||||
func (o *PostEmailMessagesOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesOK) Error() string {
|
||||
return fmt.Sprintf("[POST /emailmessages][%d] postEmailMessagesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesOK) String() string {
|
||||
return fmt.Sprintf("[POST /emailmessages][%d] postEmailMessagesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesOK) GetPayload() *members_models.EmailMessagesResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.EmailMessagesResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostEmailMessagesUnauthorized creates a PostEmailMessagesUnauthorized with default headers values
|
||||
func NewPostEmailMessagesUnauthorized() *PostEmailMessagesUnauthorized {
|
||||
return &PostEmailMessagesUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostEmailMessagesUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PostEmailMessagesUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post email messages unauthorized response has a 2xx status code
|
||||
func (o *PostEmailMessagesUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post email messages unauthorized response has a 3xx status code
|
||||
func (o *PostEmailMessagesUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post email messages unauthorized response has a 4xx status code
|
||||
func (o *PostEmailMessagesUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post email messages unauthorized response has a 5xx status code
|
||||
func (o *PostEmailMessagesUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post email messages unauthorized response a status code equal to that given
|
||||
func (o *PostEmailMessagesUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the post email messages unauthorized response
|
||||
func (o *PostEmailMessagesUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /emailmessages][%d] postEmailMessagesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesUnauthorized) String() string {
|
||||
return fmt.Sprintf("[POST /emailmessages][%d] postEmailMessagesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostEmailMessagesForbidden creates a PostEmailMessagesForbidden with default headers values
|
||||
func NewPostEmailMessagesForbidden() *PostEmailMessagesForbidden {
|
||||
return &PostEmailMessagesForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostEmailMessagesForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PostEmailMessagesForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post email messages forbidden response has a 2xx status code
|
||||
func (o *PostEmailMessagesForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post email messages forbidden response has a 3xx status code
|
||||
func (o *PostEmailMessagesForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post email messages forbidden response has a 4xx status code
|
||||
func (o *PostEmailMessagesForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post email messages forbidden response has a 5xx status code
|
||||
func (o *PostEmailMessagesForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post email messages forbidden response a status code equal to that given
|
||||
func (o *PostEmailMessagesForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the post email messages forbidden response
|
||||
func (o *PostEmailMessagesForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /emailmessages][%d] postEmailMessagesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesForbidden) String() string {
|
||||
return fmt.Sprintf("[POST /emailmessages][%d] postEmailMessagesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesForbidden) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostEmailMessagesNotFound creates a PostEmailMessagesNotFound with default headers values
|
||||
func NewPostEmailMessagesNotFound() *PostEmailMessagesNotFound {
|
||||
return &PostEmailMessagesNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostEmailMessagesNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PostEmailMessagesNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post email messages not found response has a 2xx status code
|
||||
func (o *PostEmailMessagesNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post email messages not found response has a 3xx status code
|
||||
func (o *PostEmailMessagesNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post email messages not found response has a 4xx status code
|
||||
func (o *PostEmailMessagesNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post email messages not found response has a 5xx status code
|
||||
func (o *PostEmailMessagesNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post email messages not found response a status code equal to that given
|
||||
func (o *PostEmailMessagesNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the post email messages not found response
|
||||
func (o *PostEmailMessagesNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /emailmessages][%d] postEmailMessagesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesNotFound) String() string {
|
||||
return fmt.Sprintf("[POST /emailmessages][%d] postEmailMessagesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesNotFound) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostEmailMessagesUnprocessableEntity creates a PostEmailMessagesUnprocessableEntity with default headers values
|
||||
func NewPostEmailMessagesUnprocessableEntity() *PostEmailMessagesUnprocessableEntity {
|
||||
return &PostEmailMessagesUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostEmailMessagesUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type PostEmailMessagesUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post email messages unprocessable entity response has a 2xx status code
|
||||
func (o *PostEmailMessagesUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post email messages unprocessable entity response has a 3xx status code
|
||||
func (o *PostEmailMessagesUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post email messages unprocessable entity response has a 4xx status code
|
||||
func (o *PostEmailMessagesUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post email messages unprocessable entity response has a 5xx status code
|
||||
func (o *PostEmailMessagesUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post email messages unprocessable entity response a status code equal to that given
|
||||
func (o *PostEmailMessagesUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the post email messages unprocessable entity response
|
||||
func (o *PostEmailMessagesUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /emailmessages][%d] postEmailMessagesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[POST /emailmessages][%d] postEmailMessagesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostEmailMessagesInternalServerError creates a PostEmailMessagesInternalServerError with default headers values
|
||||
func NewPostEmailMessagesInternalServerError() *PostEmailMessagesInternalServerError {
|
||||
return &PostEmailMessagesInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostEmailMessagesInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PostEmailMessagesInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post email messages internal server error response has a 2xx status code
|
||||
func (o *PostEmailMessagesInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post email messages internal server error response has a 3xx status code
|
||||
func (o *PostEmailMessagesInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post email messages internal server error response has a 4xx status code
|
||||
func (o *PostEmailMessagesInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post email messages internal server error response has a 5xx status code
|
||||
func (o *PostEmailMessagesInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this post email messages internal server error response a status code equal to that given
|
||||
func (o *PostEmailMessagesInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the post email messages internal server error response
|
||||
func (o *PostEmailMessagesInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /emailmessages][%d] postEmailMessagesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesInternalServerError) String() string {
|
||||
return fmt.Sprintf("[POST /emailmessages][%d] postEmailMessagesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostEmailMessagesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -76,12 +76,10 @@ func NewPostOutgoingEmailMessagesOK() *PostOutgoingEmailMessagesOK {
|
|||
/*
|
||||
PostOutgoingEmailMessagesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Array of Email Messages
|
||||
Array of Outgoing Email Messages
|
||||
*/
|
||||
type PostOutgoingEmailMessagesOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.EmailMessagesResponse
|
||||
Payload *members_models.OutgoingEmailMessagesResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post outgoing email messages o k response has a 2xx status code
|
||||
|
|
@ -115,27 +113,20 @@ func (o *PostOutgoingEmailMessagesOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostOutgoingEmailMessagesOK) Error() string {
|
||||
return fmt.Sprintf("[POST /emails][%d] postOutgoingEmailMessagesOK %+v", 200, o.Payload)
|
||||
return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostOutgoingEmailMessagesOK) String() string {
|
||||
return fmt.Sprintf("[POST /emails][%d] postOutgoingEmailMessagesOK %+v", 200, o.Payload)
|
||||
return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostOutgoingEmailMessagesOK) GetPayload() *members_models.EmailMessagesResponse {
|
||||
func (o *PostOutgoingEmailMessagesOK) GetPayload() *members_models.OutgoingEmailMessagesResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostOutgoingEmailMessagesOK) 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(members_models.EmailMessagesResponse)
|
||||
o.Payload = new(members_models.OutgoingEmailMessagesResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
|
|
@ -190,11 +181,11 @@ func (o *PostOutgoingEmailMessagesUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostOutgoingEmailMessagesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /emails][%d] postOutgoingEmailMessagesUnauthorized %+v", 401, o.Payload)
|
||||
return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostOutgoingEmailMessagesUnauthorized) String() string {
|
||||
return fmt.Sprintf("[POST /emails][%d] postOutgoingEmailMessagesUnauthorized %+v", 401, o.Payload)
|
||||
return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostOutgoingEmailMessagesUnauthorized) GetPayload() *members_models.Error {
|
||||
|
|
@ -260,11 +251,11 @@ func (o *PostOutgoingEmailMessagesForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostOutgoingEmailMessagesForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /emails][%d] postOutgoingEmailMessagesForbidden %+v", 403, o.Payload)
|
||||
return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostOutgoingEmailMessagesForbidden) String() string {
|
||||
return fmt.Sprintf("[POST /emails][%d] postOutgoingEmailMessagesForbidden %+v", 403, o.Payload)
|
||||
return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostOutgoingEmailMessagesForbidden) GetPayload() *members_models.Error {
|
||||
|
|
@ -301,8 +292,6 @@ PostOutgoingEmailMessagesNotFound describes a response with status code 404, wit
|
|||
Resource was not found
|
||||
*/
|
||||
type PostOutgoingEmailMessagesNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
|
|
@ -337,11 +326,11 @@ func (o *PostOutgoingEmailMessagesNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostOutgoingEmailMessagesNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /emails][%d] postOutgoingEmailMessagesNotFound %+v", 404, o.Payload)
|
||||
return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostOutgoingEmailMessagesNotFound) String() string {
|
||||
return fmt.Sprintf("[POST /emails][%d] postOutgoingEmailMessagesNotFound %+v", 404, o.Payload)
|
||||
return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostOutgoingEmailMessagesNotFound) GetPayload() *members_models.Error {
|
||||
|
|
@ -350,13 +339,6 @@ func (o *PostOutgoingEmailMessagesNotFound) GetPayload() *members_models.Error {
|
|||
|
||||
func (o *PostOutgoingEmailMessagesNotFound) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
|
|
@ -412,11 +394,11 @@ func (o *PostOutgoingEmailMessagesUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostOutgoingEmailMessagesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /emails][%d] postOutgoingEmailMessagesUnprocessableEntity %+v", 422, o.Payload)
|
||||
return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostOutgoingEmailMessagesUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[POST /emails][%d] postOutgoingEmailMessagesUnprocessableEntity %+v", 422, o.Payload)
|
||||
return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostOutgoingEmailMessagesUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
|
|
@ -446,8 +428,6 @@ PostOutgoingEmailMessagesInternalServerError describes a response with status co
|
|||
Server Internal Error
|
||||
*/
|
||||
type PostOutgoingEmailMessagesInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
|
|
@ -482,11 +462,11 @@ func (o *PostOutgoingEmailMessagesInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostOutgoingEmailMessagesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /emails][%d] postOutgoingEmailMessagesInternalServerError %+v", 500, o.Payload)
|
||||
return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostOutgoingEmailMessagesInternalServerError) String() string {
|
||||
return fmt.Sprintf("[POST /emails][%d] postOutgoingEmailMessagesInternalServerError %+v", 500, o.Payload)
|
||||
return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostOutgoingEmailMessagesInternalServerError) GetPayload() *members_models.Error {
|
||||
|
|
@ -495,13 +475,6 @@ func (o *PostOutgoingEmailMessagesInternalServerError) GetPayload() *members_mod
|
|||
|
||||
func (o *PostOutgoingEmailMessagesInternalServerError) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
|
|
|
|||
|
|
@ -1,157 +0,0 @@
|
|||
// 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 enrollments
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewCreateEnrollmentParams creates a new CreateEnrollmentParams 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 NewCreateEnrollmentParams() *CreateEnrollmentParams {
|
||||
return &CreateEnrollmentParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateEnrollmentParamsWithTimeout creates a new CreateEnrollmentParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewCreateEnrollmentParamsWithTimeout(timeout time.Duration) *CreateEnrollmentParams {
|
||||
return &CreateEnrollmentParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateEnrollmentParamsWithContext creates a new CreateEnrollmentParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewCreateEnrollmentParamsWithContext(ctx context.Context) *CreateEnrollmentParams {
|
||||
return &CreateEnrollmentParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateEnrollmentParamsWithHTTPClient creates a new CreateEnrollmentParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewCreateEnrollmentParamsWithHTTPClient(client *http.Client) *CreateEnrollmentParams {
|
||||
return &CreateEnrollmentParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateEnrollmentParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the create enrollment operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type CreateEnrollmentParams struct {
|
||||
|
||||
/* EnrollmentRequest.
|
||||
|
||||
An array of new Enrollment records
|
||||
*/
|
||||
EnrollmentRequest *members_models.EnrollmentRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the create enrollment params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *CreateEnrollmentParams) WithDefaults() *CreateEnrollmentParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the create enrollment params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *CreateEnrollmentParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the create enrollment params
|
||||
func (o *CreateEnrollmentParams) WithTimeout(timeout time.Duration) *CreateEnrollmentParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the create enrollment params
|
||||
func (o *CreateEnrollmentParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the create enrollment params
|
||||
func (o *CreateEnrollmentParams) WithContext(ctx context.Context) *CreateEnrollmentParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the create enrollment params
|
||||
func (o *CreateEnrollmentParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the create enrollment params
|
||||
func (o *CreateEnrollmentParams) WithHTTPClient(client *http.Client) *CreateEnrollmentParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the create enrollment params
|
||||
func (o *CreateEnrollmentParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithEnrollmentRequest adds the enrollmentRequest to the create enrollment params
|
||||
func (o *CreateEnrollmentParams) WithEnrollmentRequest(enrollmentRequest *members_models.EnrollmentRequest) *CreateEnrollmentParams {
|
||||
o.SetEnrollmentRequest(enrollmentRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetEnrollmentRequest adds the enrollmentRequest to the create enrollment params
|
||||
func (o *CreateEnrollmentParams) SetEnrollmentRequest(enrollmentRequest *members_models.EnrollmentRequest) {
|
||||
o.EnrollmentRequest = enrollmentRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *CreateEnrollmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.EnrollmentRequest != nil {
|
||||
if err := r.SetBodyParam(o.EnrollmentRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 enrollments
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// CreateEnrollmentReader is a Reader for the CreateEnrollment structure.
|
||||
type CreateEnrollmentReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *CreateEnrollmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 201:
|
||||
result := NewCreateEnrollmentCreated()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateEnrollmentCreated creates a CreateEnrollmentCreated with default headers values
|
||||
func NewCreateEnrollmentCreated() *CreateEnrollmentCreated {
|
||||
return &CreateEnrollmentCreated{}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateEnrollmentCreated describes a response with status code 201, with default header values.
|
||||
|
||||
Created
|
||||
*/
|
||||
type CreateEnrollmentCreated struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this create enrollment created response has a 2xx status code
|
||||
func (o *CreateEnrollmentCreated) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this create enrollment created response has a 3xx status code
|
||||
func (o *CreateEnrollmentCreated) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this create enrollment created response has a 4xx status code
|
||||
func (o *CreateEnrollmentCreated) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this create enrollment created response has a 5xx status code
|
||||
func (o *CreateEnrollmentCreated) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this create enrollment created response a status code equal to that given
|
||||
func (o *CreateEnrollmentCreated) IsCode(code int) bool {
|
||||
return code == 201
|
||||
}
|
||||
|
||||
// Code gets the status code for the create enrollment created response
|
||||
func (o *CreateEnrollmentCreated) Code() int {
|
||||
return 201
|
||||
}
|
||||
|
||||
func (o *CreateEnrollmentCreated) Error() string {
|
||||
return fmt.Sprintf("[POST /enrollments][%d] createEnrollmentCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *CreateEnrollmentCreated) String() string {
|
||||
return fmt.Sprintf("[POST /enrollments][%d] createEnrollmentCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *CreateEnrollmentCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -34,59 +34,21 @@ type ClientOption func(*runtime.ClientOperation)
|
|||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
CreateEnrollment(params *CreateEnrollmentParams, opts ...ClientOption) (*CreateEnrollmentCreated, error)
|
||||
DeleteEnrollment(params *DeleteEnrollmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEnrollmentNoContent, error)
|
||||
|
||||
DeleteEnrollment(params *DeleteEnrollmentParams, opts ...ClientOption) (*DeleteEnrollmentNoContent, error)
|
||||
GetEnrollments(params *GetEnrollmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetEnrollmentsOK, error)
|
||||
|
||||
GetEnrollments(params *GetEnrollmentsParams, opts ...ClientOption) (*GetEnrollmentsOK, error)
|
||||
PostEnrollment(params *PostEnrollmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostEnrollmentCreated, error)
|
||||
|
||||
UpdateEnrollment(params *UpdateEnrollmentParams, opts ...ClientOption) (*UpdateEnrollmentOK, error)
|
||||
UpdateEnrollment(params *UpdateEnrollmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateEnrollmentOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
CreateEnrollment creates a new enrollment
|
||||
*/
|
||||
func (a *Client) CreateEnrollment(params *CreateEnrollmentParams, opts ...ClientOption) (*CreateEnrollmentCreated, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewCreateEnrollmentParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "createEnrollment",
|
||||
Method: "POST",
|
||||
PathPattern: "/enrollments",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &CreateEnrollmentReader{formats: a.formats},
|
||||
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.(*CreateEnrollmentCreated)
|
||||
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 createEnrollment: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteEnrollment deletes a enrollment
|
||||
*/
|
||||
func (a *Client) DeleteEnrollment(params *DeleteEnrollmentParams, opts ...ClientOption) (*DeleteEnrollmentNoContent, error) {
|
||||
func (a *Client) DeleteEnrollment(params *DeleteEnrollmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEnrollmentNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteEnrollmentParams()
|
||||
|
|
@ -100,6 +62,7 @@ func (a *Client) DeleteEnrollment(params *DeleteEnrollmentParams, opts ...Client
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteEnrollmentReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
@ -124,7 +87,7 @@ func (a *Client) DeleteEnrollment(params *DeleteEnrollmentParams, opts ...Client
|
|||
/*
|
||||
GetEnrollments gets a list of enrollments
|
||||
*/
|
||||
func (a *Client) GetEnrollments(params *GetEnrollmentsParams, opts ...ClientOption) (*GetEnrollmentsOK, error) {
|
||||
func (a *Client) GetEnrollments(params *GetEnrollmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetEnrollmentsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetEnrollmentsParams()
|
||||
|
|
@ -138,6 +101,7 @@ func (a *Client) GetEnrollments(params *GetEnrollmentsParams, opts ...ClientOpti
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetEnrollmentsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
@ -159,10 +123,49 @@ func (a *Client) GetEnrollments(params *GetEnrollmentsParams, opts ...ClientOpti
|
|||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostEnrollment creates a new enrollment
|
||||
*/
|
||||
func (a *Client) PostEnrollment(params *PostEnrollmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostEnrollmentCreated, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostEnrollmentParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postEnrollment",
|
||||
Method: "POST",
|
||||
PathPattern: "/enrollments",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostEnrollmentReader{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.(*PostEnrollmentCreated)
|
||||
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 postEnrollment: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateEnrollment updates an existing enrollment
|
||||
*/
|
||||
func (a *Client) UpdateEnrollment(params *UpdateEnrollmentParams, opts ...ClientOption) (*UpdateEnrollmentOK, error) {
|
||||
func (a *Client) UpdateEnrollment(params *UpdateEnrollmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateEnrollmentOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewUpdateEnrollmentParams()
|
||||
|
|
@ -176,6 +179,7 @@ func (a *Client) UpdateEnrollment(params *UpdateEnrollmentParams, opts ...Client
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &UpdateEnrollmentReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,9 +11,12 @@ package enrollments
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
)
|
||||
|
||||
// GetEnrollmentsReader is a Reader for the GetEnrollments structure.
|
||||
|
|
@ -30,6 +33,36 @@ func (o *GetEnrollmentsReader) ReadResponse(response runtime.ClientResponse, con
|
|||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetEnrollmentsUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetEnrollmentsForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetEnrollmentsNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewGetEnrollmentsUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetEnrollmentsInternalServerError()
|
||||
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())
|
||||
}
|
||||
|
|
@ -43,9 +76,10 @@ func NewGetEnrollmentsOK() *GetEnrollmentsOK {
|
|||
/*
|
||||
GetEnrollmentsOK describes a response with status code 200, with default header values.
|
||||
|
||||
OK
|
||||
Enrollment Response Object
|
||||
*/
|
||||
type GetEnrollmentsOK struct {
|
||||
Payload *members_models.EnrollmentResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get enrollments o k response has a 2xx status code
|
||||
|
|
@ -79,14 +113,374 @@ func (o *GetEnrollmentsOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetEnrollmentsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /enrollments][%d] getEnrollmentsOK ", 200)
|
||||
return fmt.Sprintf("[GET /enrollments][%d] getEnrollmentsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsOK) String() string {
|
||||
return fmt.Sprintf("[GET /enrollments][%d] getEnrollmentsOK ", 200)
|
||||
return fmt.Sprintf("[GET /enrollments][%d] getEnrollmentsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsOK) GetPayload() *members_models.EnrollmentResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.EnrollmentResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetEnrollmentsUnauthorized creates a GetEnrollmentsUnauthorized with default headers values
|
||||
func NewGetEnrollmentsUnauthorized() *GetEnrollmentsUnauthorized {
|
||||
return &GetEnrollmentsUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetEnrollmentsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetEnrollmentsUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get enrollments unauthorized response has a 2xx status code
|
||||
func (o *GetEnrollmentsUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get enrollments unauthorized response has a 3xx status code
|
||||
func (o *GetEnrollmentsUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get enrollments unauthorized response has a 4xx status code
|
||||
func (o *GetEnrollmentsUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get enrollments unauthorized response has a 5xx status code
|
||||
func (o *GetEnrollmentsUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get enrollments unauthorized response a status code equal to that given
|
||||
func (o *GetEnrollmentsUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the get enrollments unauthorized response
|
||||
func (o *GetEnrollmentsUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /enrollments][%d] getEnrollmentsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsUnauthorized) String() string {
|
||||
return fmt.Sprintf("[GET /enrollments][%d] getEnrollmentsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetEnrollmentsForbidden creates a GetEnrollmentsForbidden with default headers values
|
||||
func NewGetEnrollmentsForbidden() *GetEnrollmentsForbidden {
|
||||
return &GetEnrollmentsForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetEnrollmentsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetEnrollmentsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get enrollments forbidden response has a 2xx status code
|
||||
func (o *GetEnrollmentsForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get enrollments forbidden response has a 3xx status code
|
||||
func (o *GetEnrollmentsForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get enrollments forbidden response has a 4xx status code
|
||||
func (o *GetEnrollmentsForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get enrollments forbidden response has a 5xx status code
|
||||
func (o *GetEnrollmentsForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get enrollments forbidden response a status code equal to that given
|
||||
func (o *GetEnrollmentsForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the get enrollments forbidden response
|
||||
func (o *GetEnrollmentsForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /enrollments][%d] getEnrollmentsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsForbidden) String() string {
|
||||
return fmt.Sprintf("[GET /enrollments][%d] getEnrollmentsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsForbidden) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetEnrollmentsNotFound creates a GetEnrollmentsNotFound with default headers values
|
||||
func NewGetEnrollmentsNotFound() *GetEnrollmentsNotFound {
|
||||
return &GetEnrollmentsNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetEnrollmentsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetEnrollmentsNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get enrollments not found response has a 2xx status code
|
||||
func (o *GetEnrollmentsNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get enrollments not found response has a 3xx status code
|
||||
func (o *GetEnrollmentsNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get enrollments not found response has a 4xx status code
|
||||
func (o *GetEnrollmentsNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get enrollments not found response has a 5xx status code
|
||||
func (o *GetEnrollmentsNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get enrollments not found response a status code equal to that given
|
||||
func (o *GetEnrollmentsNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the get enrollments not found response
|
||||
func (o *GetEnrollmentsNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /enrollments][%d] getEnrollmentsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsNotFound) String() string {
|
||||
return fmt.Sprintf("[GET /enrollments][%d] getEnrollmentsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsNotFound) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetEnrollmentsUnprocessableEntity creates a GetEnrollmentsUnprocessableEntity with default headers values
|
||||
func NewGetEnrollmentsUnprocessableEntity() *GetEnrollmentsUnprocessableEntity {
|
||||
return &GetEnrollmentsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetEnrollmentsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type GetEnrollmentsUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get enrollments unprocessable entity response has a 2xx status code
|
||||
func (o *GetEnrollmentsUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get enrollments unprocessable entity response has a 3xx status code
|
||||
func (o *GetEnrollmentsUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get enrollments unprocessable entity response has a 4xx status code
|
||||
func (o *GetEnrollmentsUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get enrollments unprocessable entity response has a 5xx status code
|
||||
func (o *GetEnrollmentsUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get enrollments unprocessable entity response a status code equal to that given
|
||||
func (o *GetEnrollmentsUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the get enrollments unprocessable entity response
|
||||
func (o *GetEnrollmentsUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /enrollments][%d] getEnrollmentsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[GET /enrollments][%d] getEnrollmentsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetEnrollmentsInternalServerError creates a GetEnrollmentsInternalServerError with default headers values
|
||||
func NewGetEnrollmentsInternalServerError() *GetEnrollmentsInternalServerError {
|
||||
return &GetEnrollmentsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetEnrollmentsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetEnrollmentsInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get enrollments internal server error response has a 2xx status code
|
||||
func (o *GetEnrollmentsInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get enrollments internal server error response has a 3xx status code
|
||||
func (o *GetEnrollmentsInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get enrollments internal server error response has a 4xx status code
|
||||
func (o *GetEnrollmentsInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get enrollments internal server error response has a 5xx status code
|
||||
func (o *GetEnrollmentsInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this get enrollments internal server error response a status code equal to that given
|
||||
func (o *GetEnrollmentsInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the get enrollments internal server error response
|
||||
func (o *GetEnrollmentsInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /enrollments][%d] getEnrollmentsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[GET /enrollments][%d] getEnrollmentsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetEnrollmentsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 enrollments
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewPostEnrollmentParams creates a new PostEnrollmentParams 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 NewPostEnrollmentParams() *PostEnrollmentParams {
|
||||
return &PostEnrollmentParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostEnrollmentParamsWithTimeout creates a new PostEnrollmentParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostEnrollmentParamsWithTimeout(timeout time.Duration) *PostEnrollmentParams {
|
||||
return &PostEnrollmentParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostEnrollmentParamsWithContext creates a new PostEnrollmentParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostEnrollmentParamsWithContext(ctx context.Context) *PostEnrollmentParams {
|
||||
return &PostEnrollmentParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostEnrollmentParamsWithHTTPClient creates a new PostEnrollmentParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostEnrollmentParamsWithHTTPClient(client *http.Client) *PostEnrollmentParams {
|
||||
return &PostEnrollmentParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostEnrollmentParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post enrollment operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostEnrollmentParams struct {
|
||||
|
||||
/* EnrollmentRequest.
|
||||
|
||||
An array of new Enrollment records
|
||||
*/
|
||||
EnrollmentRequest *members_models.EnrollmentRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post enrollment params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostEnrollmentParams) WithDefaults() *PostEnrollmentParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post enrollment params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostEnrollmentParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post enrollment params
|
||||
func (o *PostEnrollmentParams) WithTimeout(timeout time.Duration) *PostEnrollmentParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post enrollment params
|
||||
func (o *PostEnrollmentParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post enrollment params
|
||||
func (o *PostEnrollmentParams) WithContext(ctx context.Context) *PostEnrollmentParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post enrollment params
|
||||
func (o *PostEnrollmentParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post enrollment params
|
||||
func (o *PostEnrollmentParams) WithHTTPClient(client *http.Client) *PostEnrollmentParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post enrollment params
|
||||
func (o *PostEnrollmentParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithEnrollmentRequest adds the enrollmentRequest to the post enrollment params
|
||||
func (o *PostEnrollmentParams) WithEnrollmentRequest(enrollmentRequest *members_models.EnrollmentRequest) *PostEnrollmentParams {
|
||||
o.SetEnrollmentRequest(enrollmentRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetEnrollmentRequest adds the enrollmentRequest to the post enrollment params
|
||||
func (o *PostEnrollmentParams) SetEnrollmentRequest(enrollmentRequest *members_models.EnrollmentRequest) {
|
||||
o.EnrollmentRequest = enrollmentRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostEnrollmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.EnrollmentRequest != nil {
|
||||
if err := r.SetBodyParam(o.EnrollmentRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
// 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 enrollments
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// PostEnrollmentReader is a Reader for the PostEnrollment structure.
|
||||
type PostEnrollmentReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostEnrollmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 201:
|
||||
result := NewPostEnrollmentCreated()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostEnrollmentCreated creates a PostEnrollmentCreated with default headers values
|
||||
func NewPostEnrollmentCreated() *PostEnrollmentCreated {
|
||||
return &PostEnrollmentCreated{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostEnrollmentCreated describes a response with status code 201, with default header values.
|
||||
|
||||
Created
|
||||
*/
|
||||
type PostEnrollmentCreated struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post enrollment created response has a 2xx status code
|
||||
func (o *PostEnrollmentCreated) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post enrollment created response has a 3xx status code
|
||||
func (o *PostEnrollmentCreated) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post enrollment created response has a 4xx status code
|
||||
func (o *PostEnrollmentCreated) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post enrollment created response has a 5xx status code
|
||||
func (o *PostEnrollmentCreated) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post enrollment created response a status code equal to that given
|
||||
func (o *PostEnrollmentCreated) IsCode(code int) bool {
|
||||
return code == 201
|
||||
}
|
||||
|
||||
// Code gets the status code for the post enrollment created response
|
||||
func (o *PostEnrollmentCreated) Code() int {
|
||||
return 201
|
||||
}
|
||||
|
||||
func (o *PostEnrollmentCreated) Error() string {
|
||||
return fmt.Sprintf("[POST /enrollments][%d] postEnrollmentCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *PostEnrollmentCreated) String() string {
|
||||
return fmt.Sprintf("[POST /enrollments][%d] postEnrollmentCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *PostEnrollmentCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,157 +0,0 @@
|
|||
// 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 event_categories
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewCreateEventCategoryParams creates a new CreateEventCategoryParams 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 NewCreateEventCategoryParams() *CreateEventCategoryParams {
|
||||
return &CreateEventCategoryParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateEventCategoryParamsWithTimeout creates a new CreateEventCategoryParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewCreateEventCategoryParamsWithTimeout(timeout time.Duration) *CreateEventCategoryParams {
|
||||
return &CreateEventCategoryParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateEventCategoryParamsWithContext creates a new CreateEventCategoryParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewCreateEventCategoryParamsWithContext(ctx context.Context) *CreateEventCategoryParams {
|
||||
return &CreateEventCategoryParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateEventCategoryParamsWithHTTPClient creates a new CreateEventCategoryParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewCreateEventCategoryParamsWithHTTPClient(client *http.Client) *CreateEventCategoryParams {
|
||||
return &CreateEventCategoryParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateEventCategoryParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the create event category operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type CreateEventCategoryParams struct {
|
||||
|
||||
/* EventcategoryRequest.
|
||||
|
||||
An array of new EventCategory records
|
||||
*/
|
||||
EventcategoryRequest *members_models.EventCategoryRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the create event category params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *CreateEventCategoryParams) WithDefaults() *CreateEventCategoryParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the create event category params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *CreateEventCategoryParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the create event category params
|
||||
func (o *CreateEventCategoryParams) WithTimeout(timeout time.Duration) *CreateEventCategoryParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the create event category params
|
||||
func (o *CreateEventCategoryParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the create event category params
|
||||
func (o *CreateEventCategoryParams) WithContext(ctx context.Context) *CreateEventCategoryParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the create event category params
|
||||
func (o *CreateEventCategoryParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the create event category params
|
||||
func (o *CreateEventCategoryParams) WithHTTPClient(client *http.Client) *CreateEventCategoryParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the create event category params
|
||||
func (o *CreateEventCategoryParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithEventcategoryRequest adds the eventcategoryRequest to the create event category params
|
||||
func (o *CreateEventCategoryParams) WithEventcategoryRequest(eventcategoryRequest *members_models.EventCategoryRequest) *CreateEventCategoryParams {
|
||||
o.SetEventcategoryRequest(eventcategoryRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetEventcategoryRequest adds the eventcategoryRequest to the create event category params
|
||||
func (o *CreateEventCategoryParams) SetEventcategoryRequest(eventcategoryRequest *members_models.EventCategoryRequest) {
|
||||
o.EventcategoryRequest = eventcategoryRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *CreateEventCategoryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.EventcategoryRequest != nil {
|
||||
if err := r.SetBodyParam(o.EventcategoryRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 event_categories
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// CreateEventCategoryReader is a Reader for the CreateEventCategory structure.
|
||||
type CreateEventCategoryReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *CreateEventCategoryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 201:
|
||||
result := NewCreateEventCategoryCreated()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateEventCategoryCreated creates a CreateEventCategoryCreated with default headers values
|
||||
func NewCreateEventCategoryCreated() *CreateEventCategoryCreated {
|
||||
return &CreateEventCategoryCreated{}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateEventCategoryCreated describes a response with status code 201, with default header values.
|
||||
|
||||
Created
|
||||
*/
|
||||
type CreateEventCategoryCreated struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this create event category created response has a 2xx status code
|
||||
func (o *CreateEventCategoryCreated) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this create event category created response has a 3xx status code
|
||||
func (o *CreateEventCategoryCreated) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this create event category created response has a 4xx status code
|
||||
func (o *CreateEventCategoryCreated) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this create event category created response has a 5xx status code
|
||||
func (o *CreateEventCategoryCreated) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this create event category created response a status code equal to that given
|
||||
func (o *CreateEventCategoryCreated) IsCode(code int) bool {
|
||||
return code == 201
|
||||
}
|
||||
|
||||
// Code gets the status code for the create event category created response
|
||||
func (o *CreateEventCategoryCreated) Code() int {
|
||||
return 201
|
||||
}
|
||||
|
||||
func (o *CreateEventCategoryCreated) Error() string {
|
||||
return fmt.Sprintf("[POST /eventcategories][%d] createEventCategoryCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *CreateEventCategoryCreated) String() string {
|
||||
return fmt.Sprintf("[POST /eventcategories][%d] createEventCategoryCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *CreateEventCategoryCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,167 +0,0 @@
|
|||
// 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 event_categories
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewDeleteEventCategoryParams creates a new DeleteEventCategoryParams 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 NewDeleteEventCategoryParams() *DeleteEventCategoryParams {
|
||||
return &DeleteEventCategoryParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteEventCategoryParamsWithTimeout creates a new DeleteEventCategoryParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewDeleteEventCategoryParamsWithTimeout(timeout time.Duration) *DeleteEventCategoryParams {
|
||||
return &DeleteEventCategoryParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteEventCategoryParamsWithContext creates a new DeleteEventCategoryParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewDeleteEventCategoryParamsWithContext(ctx context.Context) *DeleteEventCategoryParams {
|
||||
return &DeleteEventCategoryParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteEventCategoryParamsWithHTTPClient creates a new DeleteEventCategoryParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewDeleteEventCategoryParamsWithHTTPClient(client *http.Client) *DeleteEventCategoryParams {
|
||||
return &DeleteEventCategoryParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteEventCategoryParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the delete event category operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type DeleteEventCategoryParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Unique Record ID
|
||||
*/
|
||||
ID *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the delete event category params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteEventCategoryParams) WithDefaults() *DeleteEventCategoryParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the delete event category params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteEventCategoryParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete event category params
|
||||
func (o *DeleteEventCategoryParams) WithTimeout(timeout time.Duration) *DeleteEventCategoryParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete event category params
|
||||
func (o *DeleteEventCategoryParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete event category params
|
||||
func (o *DeleteEventCategoryParams) WithContext(ctx context.Context) *DeleteEventCategoryParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete event category params
|
||||
func (o *DeleteEventCategoryParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete event category params
|
||||
func (o *DeleteEventCategoryParams) WithHTTPClient(client *http.Client) *DeleteEventCategoryParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete event category params
|
||||
func (o *DeleteEventCategoryParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the delete event category params
|
||||
func (o *DeleteEventCategoryParams) WithID(id *string) *DeleteEventCategoryParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the delete event category params
|
||||
func (o *DeleteEventCategoryParams) SetID(id *string) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *DeleteEventCategoryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.ID != nil {
|
||||
|
||||
// query param id
|
||||
var qrID string
|
||||
|
||||
if o.ID != nil {
|
||||
qrID = *o.ID
|
||||
}
|
||||
qID := qrID
|
||||
if qID != "" {
|
||||
|
||||
if err := r.SetQueryParam("id", qID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 event_categories
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// DeleteEventCategoryReader is a Reader for the DeleteEventCategory structure.
|
||||
type DeleteEventCategoryReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteEventCategoryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 204:
|
||||
result := NewDeleteEventCategoryNoContent()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteEventCategoryNoContent creates a DeleteEventCategoryNoContent with default headers values
|
||||
func NewDeleteEventCategoryNoContent() *DeleteEventCategoryNoContent {
|
||||
return &DeleteEventCategoryNoContent{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteEventCategoryNoContent describes a response with status code 204, with default header values.
|
||||
|
||||
No Content
|
||||
*/
|
||||
type DeleteEventCategoryNoContent struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this delete event category no content response has a 2xx status code
|
||||
func (o *DeleteEventCategoryNoContent) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this delete event category no content response has a 3xx status code
|
||||
func (o *DeleteEventCategoryNoContent) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this delete event category no content response has a 4xx status code
|
||||
func (o *DeleteEventCategoryNoContent) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this delete event category no content response has a 5xx status code
|
||||
func (o *DeleteEventCategoryNoContent) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this delete event category no content response a status code equal to that given
|
||||
func (o *DeleteEventCategoryNoContent) IsCode(code int) bool {
|
||||
return code == 204
|
||||
}
|
||||
|
||||
// Code gets the status code for the delete event category no content response
|
||||
func (o *DeleteEventCategoryNoContent) Code() int {
|
||||
return 204
|
||||
}
|
||||
|
||||
func (o *DeleteEventCategoryNoContent) Error() string {
|
||||
return fmt.Sprintf("[DELETE /eventcategories][%d] deleteEventCategoryNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *DeleteEventCategoryNoContent) String() string {
|
||||
return fmt.Sprintf("[DELETE /eventcategories][%d] deleteEventCategoryNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *DeleteEventCategoryNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,203 +0,0 @@
|
|||
// 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 event_categories
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// New creates a new event categories API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for event categories API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientOption is the option for Client methods
|
||||
type ClientOption func(*runtime.ClientOperation)
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
CreateEventCategory(params *CreateEventCategoryParams, opts ...ClientOption) (*CreateEventCategoryCreated, error)
|
||||
|
||||
DeleteEventCategory(params *DeleteEventCategoryParams, opts ...ClientOption) (*DeleteEventCategoryNoContent, error)
|
||||
|
||||
GetEventCategorys(params *GetEventCategorysParams, opts ...ClientOption) (*GetEventCategorysOK, error)
|
||||
|
||||
UpdateEventCategory(params *UpdateEventCategoryParams, opts ...ClientOption) (*UpdateEventCategoryOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
CreateEventCategory creates a new event category
|
||||
*/
|
||||
func (a *Client) CreateEventCategory(params *CreateEventCategoryParams, opts ...ClientOption) (*CreateEventCategoryCreated, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewCreateEventCategoryParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "createEventCategory",
|
||||
Method: "POST",
|
||||
PathPattern: "/eventcategories",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &CreateEventCategoryReader{formats: a.formats},
|
||||
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.(*CreateEventCategoryCreated)
|
||||
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 createEventCategory: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteEventCategory deletes a event category
|
||||
*/
|
||||
func (a *Client) DeleteEventCategory(params *DeleteEventCategoryParams, opts ...ClientOption) (*DeleteEventCategoryNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteEventCategoryParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "deleteEventCategory",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/eventcategories",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteEventCategoryReader{formats: a.formats},
|
||||
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.(*DeleteEventCategoryNoContent)
|
||||
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 deleteEventCategory: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetEventCategorys gets a list of event categories
|
||||
*/
|
||||
func (a *Client) GetEventCategorys(params *GetEventCategorysParams, opts ...ClientOption) (*GetEventCategorysOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetEventCategorysParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getEventCategorys",
|
||||
Method: "GET",
|
||||
PathPattern: "/eventcategories",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetEventCategorysReader{formats: a.formats},
|
||||
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.(*GetEventCategorysOK)
|
||||
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 getEventCategorys: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateEventCategory updates an existing event category
|
||||
*/
|
||||
func (a *Client) UpdateEventCategory(params *UpdateEventCategoryParams, opts ...ClientOption) (*UpdateEventCategoryOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewUpdateEventCategoryParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "updateEventCategory",
|
||||
Method: "PUT",
|
||||
PathPattern: "/eventcategories",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &UpdateEventCategoryReader{formats: a.formats},
|
||||
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.(*UpdateEventCategoryOK)
|
||||
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 updateEventCategory: 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
|
||||
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
||||
a.transport = transport
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 event_categories
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// GetEventCategorysReader is a Reader for the GetEventCategorys structure.
|
||||
type GetEventCategorysReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetEventCategorysReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetEventCategorysOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetEventCategorysOK creates a GetEventCategorysOK with default headers values
|
||||
func NewGetEventCategorysOK() *GetEventCategorysOK {
|
||||
return &GetEventCategorysOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetEventCategorysOK describes a response with status code 200, with default header values.
|
||||
|
||||
OK
|
||||
*/
|
||||
type GetEventCategorysOK struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get event categorys o k response has a 2xx status code
|
||||
func (o *GetEventCategorysOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get event categorys o k response has a 3xx status code
|
||||
func (o *GetEventCategorysOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get event categorys o k response has a 4xx status code
|
||||
func (o *GetEventCategorysOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get event categorys o k response has a 5xx status code
|
||||
func (o *GetEventCategorysOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get event categorys o k response a status code equal to that given
|
||||
func (o *GetEventCategorysOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the get event categorys o k response
|
||||
func (o *GetEventCategorysOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *GetEventCategorysOK) Error() string {
|
||||
return fmt.Sprintf("[GET /eventcategories][%d] getEventCategorysOK ", 200)
|
||||
}
|
||||
|
||||
func (o *GetEventCategorysOK) String() string {
|
||||
return fmt.Sprintf("[GET /eventcategories][%d] getEventCategorysOK ", 200)
|
||||
}
|
||||
|
||||
func (o *GetEventCategorysOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,167 +0,0 @@
|
|||
// 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 event_categories
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewUpdateEventCategoryParams creates a new UpdateEventCategoryParams 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 NewUpdateEventCategoryParams() *UpdateEventCategoryParams {
|
||||
return &UpdateEventCategoryParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateEventCategoryParamsWithTimeout creates a new UpdateEventCategoryParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewUpdateEventCategoryParamsWithTimeout(timeout time.Duration) *UpdateEventCategoryParams {
|
||||
return &UpdateEventCategoryParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateEventCategoryParamsWithContext creates a new UpdateEventCategoryParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewUpdateEventCategoryParamsWithContext(ctx context.Context) *UpdateEventCategoryParams {
|
||||
return &UpdateEventCategoryParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateEventCategoryParamsWithHTTPClient creates a new UpdateEventCategoryParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewUpdateEventCategoryParamsWithHTTPClient(client *http.Client) *UpdateEventCategoryParams {
|
||||
return &UpdateEventCategoryParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateEventCategoryParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the update event category operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type UpdateEventCategoryParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Unique Record ID
|
||||
*/
|
||||
ID *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the update event category params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *UpdateEventCategoryParams) WithDefaults() *UpdateEventCategoryParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the update event category params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *UpdateEventCategoryParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the update event category params
|
||||
func (o *UpdateEventCategoryParams) WithTimeout(timeout time.Duration) *UpdateEventCategoryParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the update event category params
|
||||
func (o *UpdateEventCategoryParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the update event category params
|
||||
func (o *UpdateEventCategoryParams) WithContext(ctx context.Context) *UpdateEventCategoryParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the update event category params
|
||||
func (o *UpdateEventCategoryParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the update event category params
|
||||
func (o *UpdateEventCategoryParams) WithHTTPClient(client *http.Client) *UpdateEventCategoryParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the update event category params
|
||||
func (o *UpdateEventCategoryParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the update event category params
|
||||
func (o *UpdateEventCategoryParams) WithID(id *string) *UpdateEventCategoryParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the update event category params
|
||||
func (o *UpdateEventCategoryParams) SetID(id *string) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *UpdateEventCategoryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.ID != nil {
|
||||
|
||||
// query param id
|
||||
var qrID string
|
||||
|
||||
if o.ID != nil {
|
||||
qrID = *o.ID
|
||||
}
|
||||
qID := qrID
|
||||
if qID != "" {
|
||||
|
||||
if err := r.SetQueryParam("id", qID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 event_categories
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// UpdateEventCategoryReader is a Reader for the UpdateEventCategory structure.
|
||||
type UpdateEventCategoryReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *UpdateEventCategoryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewUpdateEventCategoryOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateEventCategoryOK creates a UpdateEventCategoryOK with default headers values
|
||||
func NewUpdateEventCategoryOK() *UpdateEventCategoryOK {
|
||||
return &UpdateEventCategoryOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateEventCategoryOK describes a response with status code 200, with default header values.
|
||||
|
||||
OK
|
||||
*/
|
||||
type UpdateEventCategoryOK struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update event category o k response has a 2xx status code
|
||||
func (o *UpdateEventCategoryOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update event category o k response has a 3xx status code
|
||||
func (o *UpdateEventCategoryOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update event category o k response has a 4xx status code
|
||||
func (o *UpdateEventCategoryOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update event category o k response has a 5xx status code
|
||||
func (o *UpdateEventCategoryOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update event category o k response a status code equal to that given
|
||||
func (o *UpdateEventCategoryOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the update event category o k response
|
||||
func (o *UpdateEventCategoryOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *UpdateEventCategoryOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /eventcategories][%d] updateEventCategoryOK ", 200)
|
||||
}
|
||||
|
||||
func (o *UpdateEventCategoryOK) String() string {
|
||||
return fmt.Sprintf("[PUT /eventcategories][%d] updateEventCategoryOK ", 200)
|
||||
}
|
||||
|
||||
func (o *UpdateEventCategoryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,157 +0,0 @@
|
|||
// 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 event_category_assignments
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewCreateEventCategoryAssignmentParams creates a new CreateEventCategoryAssignmentParams 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 NewCreateEventCategoryAssignmentParams() *CreateEventCategoryAssignmentParams {
|
||||
return &CreateEventCategoryAssignmentParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateEventCategoryAssignmentParamsWithTimeout creates a new CreateEventCategoryAssignmentParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewCreateEventCategoryAssignmentParamsWithTimeout(timeout time.Duration) *CreateEventCategoryAssignmentParams {
|
||||
return &CreateEventCategoryAssignmentParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateEventCategoryAssignmentParamsWithContext creates a new CreateEventCategoryAssignmentParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewCreateEventCategoryAssignmentParamsWithContext(ctx context.Context) *CreateEventCategoryAssignmentParams {
|
||||
return &CreateEventCategoryAssignmentParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateEventCategoryAssignmentParamsWithHTTPClient creates a new CreateEventCategoryAssignmentParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewCreateEventCategoryAssignmentParamsWithHTTPClient(client *http.Client) *CreateEventCategoryAssignmentParams {
|
||||
return &CreateEventCategoryAssignmentParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateEventCategoryAssignmentParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the create event category assignment operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type CreateEventCategoryAssignmentParams struct {
|
||||
|
||||
/* EventcategoryassignmentRequest.
|
||||
|
||||
An array of new EventCategoryAssignment records
|
||||
*/
|
||||
EventcategoryassignmentRequest *members_models.EventCategoryAssignmentRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the create event category assignment params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *CreateEventCategoryAssignmentParams) WithDefaults() *CreateEventCategoryAssignmentParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the create event category assignment params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *CreateEventCategoryAssignmentParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the create event category assignment params
|
||||
func (o *CreateEventCategoryAssignmentParams) WithTimeout(timeout time.Duration) *CreateEventCategoryAssignmentParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the create event category assignment params
|
||||
func (o *CreateEventCategoryAssignmentParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the create event category assignment params
|
||||
func (o *CreateEventCategoryAssignmentParams) WithContext(ctx context.Context) *CreateEventCategoryAssignmentParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the create event category assignment params
|
||||
func (o *CreateEventCategoryAssignmentParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the create event category assignment params
|
||||
func (o *CreateEventCategoryAssignmentParams) WithHTTPClient(client *http.Client) *CreateEventCategoryAssignmentParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the create event category assignment params
|
||||
func (o *CreateEventCategoryAssignmentParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithEventcategoryassignmentRequest adds the eventcategoryassignmentRequest to the create event category assignment params
|
||||
func (o *CreateEventCategoryAssignmentParams) WithEventcategoryassignmentRequest(eventcategoryassignmentRequest *members_models.EventCategoryAssignmentRequest) *CreateEventCategoryAssignmentParams {
|
||||
o.SetEventcategoryassignmentRequest(eventcategoryassignmentRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetEventcategoryassignmentRequest adds the eventcategoryassignmentRequest to the create event category assignment params
|
||||
func (o *CreateEventCategoryAssignmentParams) SetEventcategoryassignmentRequest(eventcategoryassignmentRequest *members_models.EventCategoryAssignmentRequest) {
|
||||
o.EventcategoryassignmentRequest = eventcategoryassignmentRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *CreateEventCategoryAssignmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.EventcategoryassignmentRequest != nil {
|
||||
if err := r.SetBodyParam(o.EventcategoryassignmentRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 event_category_assignments
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// CreateEventCategoryAssignmentReader is a Reader for the CreateEventCategoryAssignment structure.
|
||||
type CreateEventCategoryAssignmentReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *CreateEventCategoryAssignmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 201:
|
||||
result := NewCreateEventCategoryAssignmentCreated()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateEventCategoryAssignmentCreated creates a CreateEventCategoryAssignmentCreated with default headers values
|
||||
func NewCreateEventCategoryAssignmentCreated() *CreateEventCategoryAssignmentCreated {
|
||||
return &CreateEventCategoryAssignmentCreated{}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateEventCategoryAssignmentCreated describes a response with status code 201, with default header values.
|
||||
|
||||
Created
|
||||
*/
|
||||
type CreateEventCategoryAssignmentCreated struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this create event category assignment created response has a 2xx status code
|
||||
func (o *CreateEventCategoryAssignmentCreated) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this create event category assignment created response has a 3xx status code
|
||||
func (o *CreateEventCategoryAssignmentCreated) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this create event category assignment created response has a 4xx status code
|
||||
func (o *CreateEventCategoryAssignmentCreated) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this create event category assignment created response has a 5xx status code
|
||||
func (o *CreateEventCategoryAssignmentCreated) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this create event category assignment created response a status code equal to that given
|
||||
func (o *CreateEventCategoryAssignmentCreated) IsCode(code int) bool {
|
||||
return code == 201
|
||||
}
|
||||
|
||||
// Code gets the status code for the create event category assignment created response
|
||||
func (o *CreateEventCategoryAssignmentCreated) Code() int {
|
||||
return 201
|
||||
}
|
||||
|
||||
func (o *CreateEventCategoryAssignmentCreated) Error() string {
|
||||
return fmt.Sprintf("[POST /eventcategoryassignments][%d] createEventCategoryAssignmentCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *CreateEventCategoryAssignmentCreated) String() string {
|
||||
return fmt.Sprintf("[POST /eventcategoryassignments][%d] createEventCategoryAssignmentCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *CreateEventCategoryAssignmentCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,167 +0,0 @@
|
|||
// 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 event_category_assignments
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewDeleteEventCategoryAssignmentParams creates a new DeleteEventCategoryAssignmentParams 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 NewDeleteEventCategoryAssignmentParams() *DeleteEventCategoryAssignmentParams {
|
||||
return &DeleteEventCategoryAssignmentParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteEventCategoryAssignmentParamsWithTimeout creates a new DeleteEventCategoryAssignmentParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewDeleteEventCategoryAssignmentParamsWithTimeout(timeout time.Duration) *DeleteEventCategoryAssignmentParams {
|
||||
return &DeleteEventCategoryAssignmentParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteEventCategoryAssignmentParamsWithContext creates a new DeleteEventCategoryAssignmentParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewDeleteEventCategoryAssignmentParamsWithContext(ctx context.Context) *DeleteEventCategoryAssignmentParams {
|
||||
return &DeleteEventCategoryAssignmentParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteEventCategoryAssignmentParamsWithHTTPClient creates a new DeleteEventCategoryAssignmentParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewDeleteEventCategoryAssignmentParamsWithHTTPClient(client *http.Client) *DeleteEventCategoryAssignmentParams {
|
||||
return &DeleteEventCategoryAssignmentParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteEventCategoryAssignmentParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the delete event category assignment operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type DeleteEventCategoryAssignmentParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Unique Record ID
|
||||
*/
|
||||
ID *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the delete event category assignment params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteEventCategoryAssignmentParams) WithDefaults() *DeleteEventCategoryAssignmentParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the delete event category assignment params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteEventCategoryAssignmentParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete event category assignment params
|
||||
func (o *DeleteEventCategoryAssignmentParams) WithTimeout(timeout time.Duration) *DeleteEventCategoryAssignmentParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete event category assignment params
|
||||
func (o *DeleteEventCategoryAssignmentParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete event category assignment params
|
||||
func (o *DeleteEventCategoryAssignmentParams) WithContext(ctx context.Context) *DeleteEventCategoryAssignmentParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete event category assignment params
|
||||
func (o *DeleteEventCategoryAssignmentParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete event category assignment params
|
||||
func (o *DeleteEventCategoryAssignmentParams) WithHTTPClient(client *http.Client) *DeleteEventCategoryAssignmentParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete event category assignment params
|
||||
func (o *DeleteEventCategoryAssignmentParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the delete event category assignment params
|
||||
func (o *DeleteEventCategoryAssignmentParams) WithID(id *string) *DeleteEventCategoryAssignmentParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the delete event category assignment params
|
||||
func (o *DeleteEventCategoryAssignmentParams) SetID(id *string) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *DeleteEventCategoryAssignmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.ID != nil {
|
||||
|
||||
// query param id
|
||||
var qrID string
|
||||
|
||||
if o.ID != nil {
|
||||
qrID = *o.ID
|
||||
}
|
||||
qID := qrID
|
||||
if qID != "" {
|
||||
|
||||
if err := r.SetQueryParam("id", qID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 event_category_assignments
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// DeleteEventCategoryAssignmentReader is a Reader for the DeleteEventCategoryAssignment structure.
|
||||
type DeleteEventCategoryAssignmentReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteEventCategoryAssignmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 204:
|
||||
result := NewDeleteEventCategoryAssignmentNoContent()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteEventCategoryAssignmentNoContent creates a DeleteEventCategoryAssignmentNoContent with default headers values
|
||||
func NewDeleteEventCategoryAssignmentNoContent() *DeleteEventCategoryAssignmentNoContent {
|
||||
return &DeleteEventCategoryAssignmentNoContent{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteEventCategoryAssignmentNoContent describes a response with status code 204, with default header values.
|
||||
|
||||
No Content
|
||||
*/
|
||||
type DeleteEventCategoryAssignmentNoContent struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this delete event category assignment no content response has a 2xx status code
|
||||
func (o *DeleteEventCategoryAssignmentNoContent) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this delete event category assignment no content response has a 3xx status code
|
||||
func (o *DeleteEventCategoryAssignmentNoContent) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this delete event category assignment no content response has a 4xx status code
|
||||
func (o *DeleteEventCategoryAssignmentNoContent) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this delete event category assignment no content response has a 5xx status code
|
||||
func (o *DeleteEventCategoryAssignmentNoContent) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this delete event category assignment no content response a status code equal to that given
|
||||
func (o *DeleteEventCategoryAssignmentNoContent) IsCode(code int) bool {
|
||||
return code == 204
|
||||
}
|
||||
|
||||
// Code gets the status code for the delete event category assignment no content response
|
||||
func (o *DeleteEventCategoryAssignmentNoContent) Code() int {
|
||||
return 204
|
||||
}
|
||||
|
||||
func (o *DeleteEventCategoryAssignmentNoContent) Error() string {
|
||||
return fmt.Sprintf("[DELETE /eventcategoryassignments][%d] deleteEventCategoryAssignmentNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *DeleteEventCategoryAssignmentNoContent) String() string {
|
||||
return fmt.Sprintf("[DELETE /eventcategoryassignments][%d] deleteEventCategoryAssignmentNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *DeleteEventCategoryAssignmentNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,203 +0,0 @@
|
|||
// 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 event_category_assignments
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// New creates a new event category assignments API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for event category assignments API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientOption is the option for Client methods
|
||||
type ClientOption func(*runtime.ClientOperation)
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
CreateEventCategoryAssignment(params *CreateEventCategoryAssignmentParams, opts ...ClientOption) (*CreateEventCategoryAssignmentCreated, error)
|
||||
|
||||
DeleteEventCategoryAssignment(params *DeleteEventCategoryAssignmentParams, opts ...ClientOption) (*DeleteEventCategoryAssignmentNoContent, error)
|
||||
|
||||
GetEventCategoryAssignments(params *GetEventCategoryAssignmentsParams, opts ...ClientOption) (*GetEventCategoryAssignmentsOK, error)
|
||||
|
||||
UpdateEventCategoryAssignment(params *UpdateEventCategoryAssignmentParams, opts ...ClientOption) (*UpdateEventCategoryAssignmentOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
CreateEventCategoryAssignment creates a new event category assignment
|
||||
*/
|
||||
func (a *Client) CreateEventCategoryAssignment(params *CreateEventCategoryAssignmentParams, opts ...ClientOption) (*CreateEventCategoryAssignmentCreated, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewCreateEventCategoryAssignmentParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "createEventCategoryAssignment",
|
||||
Method: "POST",
|
||||
PathPattern: "/eventcategoryassignments",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &CreateEventCategoryAssignmentReader{formats: a.formats},
|
||||
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.(*CreateEventCategoryAssignmentCreated)
|
||||
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 createEventCategoryAssignment: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteEventCategoryAssignment deletes a event category assignment
|
||||
*/
|
||||
func (a *Client) DeleteEventCategoryAssignment(params *DeleteEventCategoryAssignmentParams, opts ...ClientOption) (*DeleteEventCategoryAssignmentNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteEventCategoryAssignmentParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "deleteEventCategoryAssignment",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/eventcategoryassignments",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteEventCategoryAssignmentReader{formats: a.formats},
|
||||
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.(*DeleteEventCategoryAssignmentNoContent)
|
||||
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 deleteEventCategoryAssignment: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetEventCategoryAssignments gets a list of event categoryassignments
|
||||
*/
|
||||
func (a *Client) GetEventCategoryAssignments(params *GetEventCategoryAssignmentsParams, opts ...ClientOption) (*GetEventCategoryAssignmentsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetEventCategoryAssignmentsParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getEventCategoryAssignments",
|
||||
Method: "GET",
|
||||
PathPattern: "/eventcategoryassignments",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetEventCategoryAssignmentsReader{formats: a.formats},
|
||||
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.(*GetEventCategoryAssignmentsOK)
|
||||
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 getEventCategoryAssignments: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateEventCategoryAssignment updates an existing event category assignment
|
||||
*/
|
||||
func (a *Client) UpdateEventCategoryAssignment(params *UpdateEventCategoryAssignmentParams, opts ...ClientOption) (*UpdateEventCategoryAssignmentOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewUpdateEventCategoryAssignmentParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "updateEventCategoryAssignment",
|
||||
Method: "PUT",
|
||||
PathPattern: "/eventcategoryassignments",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &UpdateEventCategoryAssignmentReader{formats: a.formats},
|
||||
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.(*UpdateEventCategoryAssignmentOK)
|
||||
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 updateEventCategoryAssignment: 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
|
||||
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
||||
a.transport = transport
|
||||
}
|
||||
|
|
@ -1,240 +0,0 @@
|
|||
// 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 event_category_assignments
|
||||
|
||||
// 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"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewGetEventCategoryAssignmentsParams creates a new GetEventCategoryAssignmentsParams 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 NewGetEventCategoryAssignmentsParams() *GetEventCategoryAssignmentsParams {
|
||||
return &GetEventCategoryAssignmentsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetEventCategoryAssignmentsParamsWithTimeout creates a new GetEventCategoryAssignmentsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetEventCategoryAssignmentsParamsWithTimeout(timeout time.Duration) *GetEventCategoryAssignmentsParams {
|
||||
return &GetEventCategoryAssignmentsParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetEventCategoryAssignmentsParamsWithContext creates a new GetEventCategoryAssignmentsParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetEventCategoryAssignmentsParamsWithContext(ctx context.Context) *GetEventCategoryAssignmentsParams {
|
||||
return &GetEventCategoryAssignmentsParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetEventCategoryAssignmentsParamsWithHTTPClient creates a new GetEventCategoryAssignmentsParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetEventCategoryAssignmentsParamsWithHTTPClient(client *http.Client) *GetEventCategoryAssignmentsParams {
|
||||
return &GetEventCategoryAssignmentsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetEventCategoryAssignmentsParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get event category assignments operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetEventCategoryAssignmentsParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Unique Record ID
|
||||
*/
|
||||
ID *string
|
||||
|
||||
/* Limit.
|
||||
|
||||
How many objects to return at one time
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
Limit *int64
|
||||
|
||||
/* Offset.
|
||||
|
||||
How many objects to skip?
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
Offset *int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get event category assignments params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetEventCategoryAssignmentsParams) WithDefaults() *GetEventCategoryAssignmentsParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get event category assignments params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetEventCategoryAssignmentsParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get event category assignments params
|
||||
func (o *GetEventCategoryAssignmentsParams) WithTimeout(timeout time.Duration) *GetEventCategoryAssignmentsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get event category assignments params
|
||||
func (o *GetEventCategoryAssignmentsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get event category assignments params
|
||||
func (o *GetEventCategoryAssignmentsParams) WithContext(ctx context.Context) *GetEventCategoryAssignmentsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get event category assignments params
|
||||
func (o *GetEventCategoryAssignmentsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get event category assignments params
|
||||
func (o *GetEventCategoryAssignmentsParams) WithHTTPClient(client *http.Client) *GetEventCategoryAssignmentsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get event category assignments params
|
||||
func (o *GetEventCategoryAssignmentsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the get event category assignments params
|
||||
func (o *GetEventCategoryAssignmentsParams) WithID(id *string) *GetEventCategoryAssignmentsParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the get event category assignments params
|
||||
func (o *GetEventCategoryAssignmentsParams) SetID(id *string) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WithLimit adds the limit to the get event category assignments params
|
||||
func (o *GetEventCategoryAssignmentsParams) WithLimit(limit *int64) *GetEventCategoryAssignmentsParams {
|
||||
o.SetLimit(limit)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLimit adds the limit to the get event category assignments params
|
||||
func (o *GetEventCategoryAssignmentsParams) SetLimit(limit *int64) {
|
||||
o.Limit = limit
|
||||
}
|
||||
|
||||
// WithOffset adds the offset to the get event category assignments params
|
||||
func (o *GetEventCategoryAssignmentsParams) WithOffset(offset *int64) *GetEventCategoryAssignmentsParams {
|
||||
o.SetOffset(offset)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOffset adds the offset to the get event category assignments params
|
||||
func (o *GetEventCategoryAssignmentsParams) SetOffset(offset *int64) {
|
||||
o.Offset = offset
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetEventCategoryAssignmentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.ID != nil {
|
||||
|
||||
// query param id
|
||||
var qrID string
|
||||
|
||||
if o.ID != nil {
|
||||
qrID = *o.ID
|
||||
}
|
||||
qID := qrID
|
||||
if qID != "" {
|
||||
|
||||
if err := r.SetQueryParam("id", qID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if o.Limit != nil {
|
||||
|
||||
// query param limit
|
||||
var qrLimit int64
|
||||
|
||||
if o.Limit != nil {
|
||||
qrLimit = *o.Limit
|
||||
}
|
||||
qLimit := swag.FormatInt64(qrLimit)
|
||||
if qLimit != "" {
|
||||
|
||||
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if o.Offset != nil {
|
||||
|
||||
// query param offset
|
||||
var qrOffset int64
|
||||
|
||||
if o.Offset != nil {
|
||||
qrOffset = *o.Offset
|
||||
}
|
||||
qOffset := swag.FormatInt64(qrOffset)
|
||||
if qOffset != "" {
|
||||
|
||||
if err := r.SetQueryParam("offset", qOffset); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 event_category_assignments
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// GetEventCategoryAssignmentsReader is a Reader for the GetEventCategoryAssignments structure.
|
||||
type GetEventCategoryAssignmentsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetEventCategoryAssignmentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetEventCategoryAssignmentsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetEventCategoryAssignmentsOK creates a GetEventCategoryAssignmentsOK with default headers values
|
||||
func NewGetEventCategoryAssignmentsOK() *GetEventCategoryAssignmentsOK {
|
||||
return &GetEventCategoryAssignmentsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetEventCategoryAssignmentsOK describes a response with status code 200, with default header values.
|
||||
|
||||
OK
|
||||
*/
|
||||
type GetEventCategoryAssignmentsOK struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get event category assignments o k response has a 2xx status code
|
||||
func (o *GetEventCategoryAssignmentsOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get event category assignments o k response has a 3xx status code
|
||||
func (o *GetEventCategoryAssignmentsOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get event category assignments o k response has a 4xx status code
|
||||
func (o *GetEventCategoryAssignmentsOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get event category assignments o k response has a 5xx status code
|
||||
func (o *GetEventCategoryAssignmentsOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get event category assignments o k response a status code equal to that given
|
||||
func (o *GetEventCategoryAssignmentsOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the get event category assignments o k response
|
||||
func (o *GetEventCategoryAssignmentsOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *GetEventCategoryAssignmentsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /eventcategoryassignments][%d] getEventCategoryAssignmentsOK ", 200)
|
||||
}
|
||||
|
||||
func (o *GetEventCategoryAssignmentsOK) String() string {
|
||||
return fmt.Sprintf("[GET /eventcategoryassignments][%d] getEventCategoryAssignmentsOK ", 200)
|
||||
}
|
||||
|
||||
func (o *GetEventCategoryAssignmentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,167 +0,0 @@
|
|||
// 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 event_category_assignments
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewUpdateEventCategoryAssignmentParams creates a new UpdateEventCategoryAssignmentParams 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 NewUpdateEventCategoryAssignmentParams() *UpdateEventCategoryAssignmentParams {
|
||||
return &UpdateEventCategoryAssignmentParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateEventCategoryAssignmentParamsWithTimeout creates a new UpdateEventCategoryAssignmentParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewUpdateEventCategoryAssignmentParamsWithTimeout(timeout time.Duration) *UpdateEventCategoryAssignmentParams {
|
||||
return &UpdateEventCategoryAssignmentParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateEventCategoryAssignmentParamsWithContext creates a new UpdateEventCategoryAssignmentParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewUpdateEventCategoryAssignmentParamsWithContext(ctx context.Context) *UpdateEventCategoryAssignmentParams {
|
||||
return &UpdateEventCategoryAssignmentParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateEventCategoryAssignmentParamsWithHTTPClient creates a new UpdateEventCategoryAssignmentParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewUpdateEventCategoryAssignmentParamsWithHTTPClient(client *http.Client) *UpdateEventCategoryAssignmentParams {
|
||||
return &UpdateEventCategoryAssignmentParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateEventCategoryAssignmentParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the update event category assignment operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type UpdateEventCategoryAssignmentParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Unique Record ID
|
||||
*/
|
||||
ID *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the update event category assignment params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *UpdateEventCategoryAssignmentParams) WithDefaults() *UpdateEventCategoryAssignmentParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the update event category assignment params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *UpdateEventCategoryAssignmentParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the update event category assignment params
|
||||
func (o *UpdateEventCategoryAssignmentParams) WithTimeout(timeout time.Duration) *UpdateEventCategoryAssignmentParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the update event category assignment params
|
||||
func (o *UpdateEventCategoryAssignmentParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the update event category assignment params
|
||||
func (o *UpdateEventCategoryAssignmentParams) WithContext(ctx context.Context) *UpdateEventCategoryAssignmentParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the update event category assignment params
|
||||
func (o *UpdateEventCategoryAssignmentParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the update event category assignment params
|
||||
func (o *UpdateEventCategoryAssignmentParams) WithHTTPClient(client *http.Client) *UpdateEventCategoryAssignmentParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the update event category assignment params
|
||||
func (o *UpdateEventCategoryAssignmentParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the update event category assignment params
|
||||
func (o *UpdateEventCategoryAssignmentParams) WithID(id *string) *UpdateEventCategoryAssignmentParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the update event category assignment params
|
||||
func (o *UpdateEventCategoryAssignmentParams) SetID(id *string) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *UpdateEventCategoryAssignmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.ID != nil {
|
||||
|
||||
// query param id
|
||||
var qrID string
|
||||
|
||||
if o.ID != nil {
|
||||
qrID = *o.ID
|
||||
}
|
||||
qID := qrID
|
||||
if qID != "" {
|
||||
|
||||
if err := r.SetQueryParam("id", qID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 event_category_assignments
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// UpdateEventCategoryAssignmentReader is a Reader for the UpdateEventCategoryAssignment structure.
|
||||
type UpdateEventCategoryAssignmentReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *UpdateEventCategoryAssignmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewUpdateEventCategoryAssignmentOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewUpdateEventCategoryAssignmentOK creates a UpdateEventCategoryAssignmentOK with default headers values
|
||||
func NewUpdateEventCategoryAssignmentOK() *UpdateEventCategoryAssignmentOK {
|
||||
return &UpdateEventCategoryAssignmentOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateEventCategoryAssignmentOK describes a response with status code 200, with default header values.
|
||||
|
||||
OK
|
||||
*/
|
||||
type UpdateEventCategoryAssignmentOK struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update event category assignment o k response has a 2xx status code
|
||||
func (o *UpdateEventCategoryAssignmentOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update event category assignment o k response has a 3xx status code
|
||||
func (o *UpdateEventCategoryAssignmentOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update event category assignment o k response has a 4xx status code
|
||||
func (o *UpdateEventCategoryAssignmentOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update event category assignment o k response has a 5xx status code
|
||||
func (o *UpdateEventCategoryAssignmentOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update event category assignment o k response a status code equal to that given
|
||||
func (o *UpdateEventCategoryAssignmentOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the update event category assignment o k response
|
||||
func (o *UpdateEventCategoryAssignmentOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *UpdateEventCategoryAssignmentOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /eventcategoryassignments][%d] updateEventCategoryAssignmentOK ", 200)
|
||||
}
|
||||
|
||||
func (o *UpdateEventCategoryAssignmentOK) String() string {
|
||||
return fmt.Sprintf("[PUT /eventcategoryassignments][%d] updateEventCategoryAssignmentOK ", 200)
|
||||
}
|
||||
|
||||
func (o *UpdateEventCategoryAssignmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,157 +0,0 @@
|
|||
// 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 events
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewCreateEventParams creates a new CreateEventParams 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 NewCreateEventParams() *CreateEventParams {
|
||||
return &CreateEventParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateEventParamsWithTimeout creates a new CreateEventParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewCreateEventParamsWithTimeout(timeout time.Duration) *CreateEventParams {
|
||||
return &CreateEventParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateEventParamsWithContext creates a new CreateEventParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewCreateEventParamsWithContext(ctx context.Context) *CreateEventParams {
|
||||
return &CreateEventParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateEventParamsWithHTTPClient creates a new CreateEventParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewCreateEventParamsWithHTTPClient(client *http.Client) *CreateEventParams {
|
||||
return &CreateEventParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateEventParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the create event operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type CreateEventParams struct {
|
||||
|
||||
/* EventRequest.
|
||||
|
||||
An array of new Event records
|
||||
*/
|
||||
EventRequest *members_models.EventRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the create event params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *CreateEventParams) WithDefaults() *CreateEventParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the create event params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *CreateEventParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the create event params
|
||||
func (o *CreateEventParams) WithTimeout(timeout time.Duration) *CreateEventParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the create event params
|
||||
func (o *CreateEventParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the create event params
|
||||
func (o *CreateEventParams) WithContext(ctx context.Context) *CreateEventParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the create event params
|
||||
func (o *CreateEventParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the create event params
|
||||
func (o *CreateEventParams) WithHTTPClient(client *http.Client) *CreateEventParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the create event params
|
||||
func (o *CreateEventParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithEventRequest adds the eventRequest to the create event params
|
||||
func (o *CreateEventParams) WithEventRequest(eventRequest *members_models.EventRequest) *CreateEventParams {
|
||||
o.SetEventRequest(eventRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetEventRequest adds the eventRequest to the create event params
|
||||
func (o *CreateEventParams) SetEventRequest(eventRequest *members_models.EventRequest) {
|
||||
o.EventRequest = eventRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *CreateEventParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.EventRequest != nil {
|
||||
if err := r.SetBodyParam(o.EventRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 events
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// CreateEventReader is a Reader for the CreateEvent structure.
|
||||
type CreateEventReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *CreateEventReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 201:
|
||||
result := NewCreateEventCreated()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateEventCreated creates a CreateEventCreated with default headers values
|
||||
func NewCreateEventCreated() *CreateEventCreated {
|
||||
return &CreateEventCreated{}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateEventCreated describes a response with status code 201, with default header values.
|
||||
|
||||
Created
|
||||
*/
|
||||
type CreateEventCreated struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this create event created response has a 2xx status code
|
||||
func (o *CreateEventCreated) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this create event created response has a 3xx status code
|
||||
func (o *CreateEventCreated) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this create event created response has a 4xx status code
|
||||
func (o *CreateEventCreated) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this create event created response has a 5xx status code
|
||||
func (o *CreateEventCreated) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this create event created response a status code equal to that given
|
||||
func (o *CreateEventCreated) IsCode(code int) bool {
|
||||
return code == 201
|
||||
}
|
||||
|
||||
// Code gets the status code for the create event created response
|
||||
func (o *CreateEventCreated) Code() int {
|
||||
return 201
|
||||
}
|
||||
|
||||
func (o *CreateEventCreated) Error() string {
|
||||
return fmt.Sprintf("[POST /events][%d] createEventCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *CreateEventCreated) String() string {
|
||||
return fmt.Sprintf("[POST /events][%d] createEventCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *CreateEventCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -34,97 +34,19 @@ type ClientOption func(*runtime.ClientOperation)
|
|||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
CreateEvent(params *CreateEventParams, opts ...ClientOption) (*CreateEventCreated, error)
|
||||
GetEvents(params *GetEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetEventsOK, error)
|
||||
|
||||
DeleteEvent(params *DeleteEventParams, opts ...ClientOption) (*DeleteEventNoContent, error)
|
||||
PostEvents(params *PostEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostEventsOK, error)
|
||||
|
||||
GetEvents(params *GetEventsParams, opts ...ClientOption) (*GetEventsOK, error)
|
||||
|
||||
UpdateEvent(params *UpdateEventParams, opts ...ClientOption) (*UpdateEventOK, error)
|
||||
UpdateEvent(params *UpdateEventParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateEventOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
CreateEvent creates a new event
|
||||
*/
|
||||
func (a *Client) CreateEvent(params *CreateEventParams, opts ...ClientOption) (*CreateEventCreated, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewCreateEventParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "createEvent",
|
||||
Method: "POST",
|
||||
PathPattern: "/events",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &CreateEventReader{formats: a.formats},
|
||||
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.(*CreateEventCreated)
|
||||
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 createEvent: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteEvent deletes a event
|
||||
*/
|
||||
func (a *Client) DeleteEvent(params *DeleteEventParams, opts ...ClientOption) (*DeleteEventNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteEventParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "deleteEvent",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/events",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteEventReader{formats: a.formats},
|
||||
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.(*DeleteEventNoContent)
|
||||
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 deleteEvent: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetEvents gets a list of events
|
||||
*/
|
||||
func (a *Client) GetEvents(params *GetEventsParams, opts ...ClientOption) (*GetEventsOK, error) {
|
||||
func (a *Client) GetEvents(params *GetEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetEventsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetEventsParams()
|
||||
|
|
@ -138,6 +60,7 @@ func (a *Client) GetEvents(params *GetEventsParams, opts ...ClientOption) (*GetE
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetEventsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
@ -159,10 +82,49 @@ func (a *Client) GetEvents(params *GetEventsParams, opts ...ClientOption) (*GetE
|
|||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostEvents creates a new event
|
||||
*/
|
||||
func (a *Client) PostEvents(params *PostEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostEventsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostEventsParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postEvents",
|
||||
Method: "POST",
|
||||
PathPattern: "/events",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostEventsReader{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.(*PostEventsOK)
|
||||
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 postEvents: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateEvent updates an existing event
|
||||
*/
|
||||
func (a *Client) UpdateEvent(params *UpdateEventParams, opts ...ClientOption) (*UpdateEventOK, error) {
|
||||
func (a *Client) UpdateEvent(params *UpdateEventParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateEventOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewUpdateEventParams()
|
||||
|
|
@ -176,6 +138,7 @@ func (a *Client) UpdateEvent(params *UpdateEventParams, opts ...ClientOption) (*
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &UpdateEventReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,9 +11,12 @@ package events
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
)
|
||||
|
||||
// GetEventsReader is a Reader for the GetEvents structure.
|
||||
|
|
@ -30,6 +33,36 @@ func (o *GetEventsReader) ReadResponse(response runtime.ClientResponse, consumer
|
|||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetEventsUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetEventsForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetEventsNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewGetEventsUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetEventsInternalServerError()
|
||||
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())
|
||||
}
|
||||
|
|
@ -43,9 +76,10 @@ func NewGetEventsOK() *GetEventsOK {
|
|||
/*
|
||||
GetEventsOK describes a response with status code 200, with default header values.
|
||||
|
||||
OK
|
||||
Event Response Object
|
||||
*/
|
||||
type GetEventsOK struct {
|
||||
Payload *members_models.EventResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get events o k response has a 2xx status code
|
||||
|
|
@ -79,14 +113,374 @@ func (o *GetEventsOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetEventsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /events][%d] getEventsOK ", 200)
|
||||
return fmt.Sprintf("[GET /events][%d] getEventsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEventsOK) String() string {
|
||||
return fmt.Sprintf("[GET /events][%d] getEventsOK ", 200)
|
||||
return fmt.Sprintf("[GET /events][%d] getEventsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEventsOK) GetPayload() *members_models.EventResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetEventsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.EventResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetEventsUnauthorized creates a GetEventsUnauthorized with default headers values
|
||||
func NewGetEventsUnauthorized() *GetEventsUnauthorized {
|
||||
return &GetEventsUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetEventsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetEventsUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get events unauthorized response has a 2xx status code
|
||||
func (o *GetEventsUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get events unauthorized response has a 3xx status code
|
||||
func (o *GetEventsUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get events unauthorized response has a 4xx status code
|
||||
func (o *GetEventsUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get events unauthorized response has a 5xx status code
|
||||
func (o *GetEventsUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get events unauthorized response a status code equal to that given
|
||||
func (o *GetEventsUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the get events unauthorized response
|
||||
func (o *GetEventsUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *GetEventsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /events][%d] getEventsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEventsUnauthorized) String() string {
|
||||
return fmt.Sprintf("[GET /events][%d] getEventsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEventsUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetEventsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetEventsForbidden creates a GetEventsForbidden with default headers values
|
||||
func NewGetEventsForbidden() *GetEventsForbidden {
|
||||
return &GetEventsForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetEventsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetEventsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get events forbidden response has a 2xx status code
|
||||
func (o *GetEventsForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get events forbidden response has a 3xx status code
|
||||
func (o *GetEventsForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get events forbidden response has a 4xx status code
|
||||
func (o *GetEventsForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get events forbidden response has a 5xx status code
|
||||
func (o *GetEventsForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get events forbidden response a status code equal to that given
|
||||
func (o *GetEventsForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the get events forbidden response
|
||||
func (o *GetEventsForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *GetEventsForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /events][%d] getEventsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEventsForbidden) String() string {
|
||||
return fmt.Sprintf("[GET /events][%d] getEventsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEventsForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetEventsForbidden) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetEventsNotFound creates a GetEventsNotFound with default headers values
|
||||
func NewGetEventsNotFound() *GetEventsNotFound {
|
||||
return &GetEventsNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetEventsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetEventsNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get events not found response has a 2xx status code
|
||||
func (o *GetEventsNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get events not found response has a 3xx status code
|
||||
func (o *GetEventsNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get events not found response has a 4xx status code
|
||||
func (o *GetEventsNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get events not found response has a 5xx status code
|
||||
func (o *GetEventsNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get events not found response a status code equal to that given
|
||||
func (o *GetEventsNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the get events not found response
|
||||
func (o *GetEventsNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *GetEventsNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /events][%d] getEventsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEventsNotFound) String() string {
|
||||
return fmt.Sprintf("[GET /events][%d] getEventsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEventsNotFound) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetEventsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetEventsUnprocessableEntity creates a GetEventsUnprocessableEntity with default headers values
|
||||
func NewGetEventsUnprocessableEntity() *GetEventsUnprocessableEntity {
|
||||
return &GetEventsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetEventsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type GetEventsUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get events unprocessable entity response has a 2xx status code
|
||||
func (o *GetEventsUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get events unprocessable entity response has a 3xx status code
|
||||
func (o *GetEventsUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get events unprocessable entity response has a 4xx status code
|
||||
func (o *GetEventsUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get events unprocessable entity response has a 5xx status code
|
||||
func (o *GetEventsUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get events unprocessable entity response a status code equal to that given
|
||||
func (o *GetEventsUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the get events unprocessable entity response
|
||||
func (o *GetEventsUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *GetEventsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /events][%d] getEventsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEventsUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[GET /events][%d] getEventsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEventsUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetEventsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetEventsInternalServerError creates a GetEventsInternalServerError with default headers values
|
||||
func NewGetEventsInternalServerError() *GetEventsInternalServerError {
|
||||
return &GetEventsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetEventsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetEventsInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get events internal server error response has a 2xx status code
|
||||
func (o *GetEventsInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get events internal server error response has a 3xx status code
|
||||
func (o *GetEventsInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get events internal server error response has a 4xx status code
|
||||
func (o *GetEventsInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get events internal server error response has a 5xx status code
|
||||
func (o *GetEventsInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this get events internal server error response a status code equal to that given
|
||||
func (o *GetEventsInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the get events internal server error response
|
||||
func (o *GetEventsInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *GetEventsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /events][%d] getEventsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEventsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[GET /events][%d] getEventsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetEventsInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetEventsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 events
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewPostEventsParams creates a new PostEventsParams 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 NewPostEventsParams() *PostEventsParams {
|
||||
return &PostEventsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostEventsParamsWithTimeout creates a new PostEventsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostEventsParamsWithTimeout(timeout time.Duration) *PostEventsParams {
|
||||
return &PostEventsParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostEventsParamsWithContext creates a new PostEventsParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostEventsParamsWithContext(ctx context.Context) *PostEventsParams {
|
||||
return &PostEventsParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostEventsParamsWithHTTPClient creates a new PostEventsParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostEventsParamsWithHTTPClient(client *http.Client) *PostEventsParams {
|
||||
return &PostEventsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostEventsParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post events operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostEventsParams struct {
|
||||
|
||||
/* EventRequest.
|
||||
|
||||
An array of new Event records
|
||||
*/
|
||||
EventRequest *members_models.EventRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post events params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostEventsParams) WithDefaults() *PostEventsParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post events params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostEventsParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post events params
|
||||
func (o *PostEventsParams) WithTimeout(timeout time.Duration) *PostEventsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post events params
|
||||
func (o *PostEventsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post events params
|
||||
func (o *PostEventsParams) WithContext(ctx context.Context) *PostEventsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post events params
|
||||
func (o *PostEventsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post events params
|
||||
func (o *PostEventsParams) WithHTTPClient(client *http.Client) *PostEventsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post events params
|
||||
func (o *PostEventsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithEventRequest adds the eventRequest to the post events params
|
||||
func (o *PostEventsParams) WithEventRequest(eventRequest *members_models.EventRequest) *PostEventsParams {
|
||||
o.SetEventRequest(eventRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetEventRequest adds the eventRequest to the post events params
|
||||
func (o *PostEventsParams) SetEventRequest(eventRequest *members_models.EventRequest) {
|
||||
o.EventRequest = eventRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostEventsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.EventRequest != nil {
|
||||
if err := r.SetBodyParam(o.EventRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,486 @@
|
|||
// 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 events
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// PostEventsReader is a Reader for the PostEvents structure.
|
||||
type PostEventsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostEventsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostEventsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPostEventsUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPostEventsForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPostEventsNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPostEventsUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPostEventsInternalServerError()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostEventsOK creates a PostEventsOK with default headers values
|
||||
func NewPostEventsOK() *PostEventsOK {
|
||||
return &PostEventsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostEventsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Event Response Object
|
||||
*/
|
||||
type PostEventsOK struct {
|
||||
Payload *members_models.EventResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post events o k response has a 2xx status code
|
||||
func (o *PostEventsOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post events o k response has a 3xx status code
|
||||
func (o *PostEventsOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post events o k response has a 4xx status code
|
||||
func (o *PostEventsOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post events o k response has a 5xx status code
|
||||
func (o *PostEventsOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post events o k response a status code equal to that given
|
||||
func (o *PostEventsOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the post events o k response
|
||||
func (o *PostEventsOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *PostEventsOK) Error() string {
|
||||
return fmt.Sprintf("[POST /events][%d] postEventsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEventsOK) String() string {
|
||||
return fmt.Sprintf("[POST /events][%d] postEventsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEventsOK) GetPayload() *members_models.EventResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostEventsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.EventResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostEventsUnauthorized creates a PostEventsUnauthorized with default headers values
|
||||
func NewPostEventsUnauthorized() *PostEventsUnauthorized {
|
||||
return &PostEventsUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostEventsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PostEventsUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post events unauthorized response has a 2xx status code
|
||||
func (o *PostEventsUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post events unauthorized response has a 3xx status code
|
||||
func (o *PostEventsUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post events unauthorized response has a 4xx status code
|
||||
func (o *PostEventsUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post events unauthorized response has a 5xx status code
|
||||
func (o *PostEventsUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post events unauthorized response a status code equal to that given
|
||||
func (o *PostEventsUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the post events unauthorized response
|
||||
func (o *PostEventsUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *PostEventsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /events][%d] postEventsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEventsUnauthorized) String() string {
|
||||
return fmt.Sprintf("[POST /events][%d] postEventsUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEventsUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostEventsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostEventsForbidden creates a PostEventsForbidden with default headers values
|
||||
func NewPostEventsForbidden() *PostEventsForbidden {
|
||||
return &PostEventsForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostEventsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PostEventsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post events forbidden response has a 2xx status code
|
||||
func (o *PostEventsForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post events forbidden response has a 3xx status code
|
||||
func (o *PostEventsForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post events forbidden response has a 4xx status code
|
||||
func (o *PostEventsForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post events forbidden response has a 5xx status code
|
||||
func (o *PostEventsForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post events forbidden response a status code equal to that given
|
||||
func (o *PostEventsForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the post events forbidden response
|
||||
func (o *PostEventsForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *PostEventsForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /events][%d] postEventsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEventsForbidden) String() string {
|
||||
return fmt.Sprintf("[POST /events][%d] postEventsForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEventsForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostEventsForbidden) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostEventsNotFound creates a PostEventsNotFound with default headers values
|
||||
func NewPostEventsNotFound() *PostEventsNotFound {
|
||||
return &PostEventsNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostEventsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PostEventsNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post events not found response has a 2xx status code
|
||||
func (o *PostEventsNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post events not found response has a 3xx status code
|
||||
func (o *PostEventsNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post events not found response has a 4xx status code
|
||||
func (o *PostEventsNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post events not found response has a 5xx status code
|
||||
func (o *PostEventsNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post events not found response a status code equal to that given
|
||||
func (o *PostEventsNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the post events not found response
|
||||
func (o *PostEventsNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *PostEventsNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /events][%d] postEventsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEventsNotFound) String() string {
|
||||
return fmt.Sprintf("[POST /events][%d] postEventsNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEventsNotFound) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostEventsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostEventsUnprocessableEntity creates a PostEventsUnprocessableEntity with default headers values
|
||||
func NewPostEventsUnprocessableEntity() *PostEventsUnprocessableEntity {
|
||||
return &PostEventsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostEventsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type PostEventsUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post events unprocessable entity response has a 2xx status code
|
||||
func (o *PostEventsUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post events unprocessable entity response has a 3xx status code
|
||||
func (o *PostEventsUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post events unprocessable entity response has a 4xx status code
|
||||
func (o *PostEventsUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post events unprocessable entity response has a 5xx status code
|
||||
func (o *PostEventsUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post events unprocessable entity response a status code equal to that given
|
||||
func (o *PostEventsUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the post events unprocessable entity response
|
||||
func (o *PostEventsUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *PostEventsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /events][%d] postEventsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEventsUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[POST /events][%d] postEventsUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEventsUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostEventsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostEventsInternalServerError creates a PostEventsInternalServerError with default headers values
|
||||
func NewPostEventsInternalServerError() *PostEventsInternalServerError {
|
||||
return &PostEventsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostEventsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PostEventsInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post events internal server error response has a 2xx status code
|
||||
func (o *PostEventsInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post events internal server error response has a 3xx status code
|
||||
func (o *PostEventsInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post events internal server error response has a 4xx status code
|
||||
func (o *PostEventsInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post events internal server error response has a 5xx status code
|
||||
func (o *PostEventsInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this post events internal server error response a status code equal to that given
|
||||
func (o *PostEventsInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the post events internal server error response
|
||||
func (o *PostEventsInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *PostEventsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /events][%d] postEventsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEventsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[POST /events][%d] postEventsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostEventsInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostEventsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -11,9 +11,12 @@ package events
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
)
|
||||
|
||||
// UpdateEventReader is a Reader for the UpdateEvent structure.
|
||||
|
|
@ -30,6 +33,36 @@ func (o *UpdateEventReader) ReadResponse(response runtime.ClientResponse, consum
|
|||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewUpdateEventUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewUpdateEventForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewUpdateEventNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewUpdateEventUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewUpdateEventInternalServerError()
|
||||
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())
|
||||
}
|
||||
|
|
@ -43,9 +76,10 @@ func NewUpdateEventOK() *UpdateEventOK {
|
|||
/*
|
||||
UpdateEventOK describes a response with status code 200, with default header values.
|
||||
|
||||
OK
|
||||
Event Response Object
|
||||
*/
|
||||
type UpdateEventOK struct {
|
||||
Payload *members_models.EventResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update event o k response has a 2xx status code
|
||||
|
|
@ -79,14 +113,374 @@ func (o *UpdateEventOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *UpdateEventOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /events][%d] updateEventOK ", 200)
|
||||
return fmt.Sprintf("[PUT /events][%d] updateEventOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateEventOK) String() string {
|
||||
return fmt.Sprintf("[PUT /events][%d] updateEventOK ", 200)
|
||||
return fmt.Sprintf("[PUT /events][%d] updateEventOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateEventOK) GetPayload() *members_models.EventResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateEventOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.EventResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewUpdateEventUnauthorized creates a UpdateEventUnauthorized with default headers values
|
||||
func NewUpdateEventUnauthorized() *UpdateEventUnauthorized {
|
||||
return &UpdateEventUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateEventUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type UpdateEventUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update event unauthorized response has a 2xx status code
|
||||
func (o *UpdateEventUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update event unauthorized response has a 3xx status code
|
||||
func (o *UpdateEventUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update event unauthorized response has a 4xx status code
|
||||
func (o *UpdateEventUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update event unauthorized response has a 5xx status code
|
||||
func (o *UpdateEventUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update event unauthorized response a status code equal to that given
|
||||
func (o *UpdateEventUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the update event unauthorized response
|
||||
func (o *UpdateEventUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *UpdateEventUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[PUT /events][%d] updateEventUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateEventUnauthorized) String() string {
|
||||
return fmt.Sprintf("[PUT /events][%d] updateEventUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateEventUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateEventUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewUpdateEventForbidden creates a UpdateEventForbidden with default headers values
|
||||
func NewUpdateEventForbidden() *UpdateEventForbidden {
|
||||
return &UpdateEventForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateEventForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type UpdateEventForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update event forbidden response has a 2xx status code
|
||||
func (o *UpdateEventForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update event forbidden response has a 3xx status code
|
||||
func (o *UpdateEventForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update event forbidden response has a 4xx status code
|
||||
func (o *UpdateEventForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update event forbidden response has a 5xx status code
|
||||
func (o *UpdateEventForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update event forbidden response a status code equal to that given
|
||||
func (o *UpdateEventForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the update event forbidden response
|
||||
func (o *UpdateEventForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *UpdateEventForbidden) Error() string {
|
||||
return fmt.Sprintf("[PUT /events][%d] updateEventForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateEventForbidden) String() string {
|
||||
return fmt.Sprintf("[PUT /events][%d] updateEventForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateEventForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateEventForbidden) 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(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewUpdateEventNotFound creates a UpdateEventNotFound with default headers values
|
||||
func NewUpdateEventNotFound() *UpdateEventNotFound {
|
||||
return &UpdateEventNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateEventNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type UpdateEventNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update event not found response has a 2xx status code
|
||||
func (o *UpdateEventNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update event not found response has a 3xx status code
|
||||
func (o *UpdateEventNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update event not found response has a 4xx status code
|
||||
func (o *UpdateEventNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update event not found response has a 5xx status code
|
||||
func (o *UpdateEventNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update event not found response a status code equal to that given
|
||||
func (o *UpdateEventNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the update event not found response
|
||||
func (o *UpdateEventNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *UpdateEventNotFound) Error() string {
|
||||
return fmt.Sprintf("[PUT /events][%d] updateEventNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateEventNotFound) String() string {
|
||||
return fmt.Sprintf("[PUT /events][%d] updateEventNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateEventNotFound) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateEventNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewUpdateEventUnprocessableEntity creates a UpdateEventUnprocessableEntity with default headers values
|
||||
func NewUpdateEventUnprocessableEntity() *UpdateEventUnprocessableEntity {
|
||||
return &UpdateEventUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateEventUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type UpdateEventUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update event unprocessable entity response has a 2xx status code
|
||||
func (o *UpdateEventUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update event unprocessable entity response has a 3xx status code
|
||||
func (o *UpdateEventUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update event unprocessable entity response has a 4xx status code
|
||||
func (o *UpdateEventUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update event unprocessable entity response has a 5xx status code
|
||||
func (o *UpdateEventUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this update event unprocessable entity response a status code equal to that given
|
||||
func (o *UpdateEventUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the update event unprocessable entity response
|
||||
func (o *UpdateEventUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *UpdateEventUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PUT /events][%d] updateEventUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateEventUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[PUT /events][%d] updateEventUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateEventUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateEventUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewUpdateEventInternalServerError creates a UpdateEventInternalServerError with default headers values
|
||||
func NewUpdateEventInternalServerError() *UpdateEventInternalServerError {
|
||||
return &UpdateEventInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateEventInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type UpdateEventInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this update event internal server error response has a 2xx status code
|
||||
func (o *UpdateEventInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this update event internal server error response has a 3xx status code
|
||||
func (o *UpdateEventInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this update event internal server error response has a 4xx status code
|
||||
func (o *UpdateEventInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this update event internal server error response has a 5xx status code
|
||||
func (o *UpdateEventInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this update event internal server error response a status code equal to that given
|
||||
func (o *UpdateEventInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the update event internal server error response
|
||||
func (o *UpdateEventInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *UpdateEventInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[PUT /events][%d] updateEventInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateEventInternalServerError) String() string {
|
||||
return fmt.Sprintf("[PUT /events][%d] updateEventInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *UpdateEventInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *UpdateEventInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,157 +0,0 @@
|
|||
// 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 favorites
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewCreateFavoriteParams creates a new CreateFavoriteParams 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 NewCreateFavoriteParams() *CreateFavoriteParams {
|
||||
return &CreateFavoriteParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateFavoriteParamsWithTimeout creates a new CreateFavoriteParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewCreateFavoriteParamsWithTimeout(timeout time.Duration) *CreateFavoriteParams {
|
||||
return &CreateFavoriteParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateFavoriteParamsWithContext creates a new CreateFavoriteParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewCreateFavoriteParamsWithContext(ctx context.Context) *CreateFavoriteParams {
|
||||
return &CreateFavoriteParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateFavoriteParamsWithHTTPClient creates a new CreateFavoriteParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewCreateFavoriteParamsWithHTTPClient(client *http.Client) *CreateFavoriteParams {
|
||||
return &CreateFavoriteParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateFavoriteParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the create favorite operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type CreateFavoriteParams struct {
|
||||
|
||||
/* FavoriteRequest.
|
||||
|
||||
An array of new Favorite records
|
||||
*/
|
||||
FavoriteRequest *members_models.FavoriteRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the create favorite params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *CreateFavoriteParams) WithDefaults() *CreateFavoriteParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the create favorite params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *CreateFavoriteParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the create favorite params
|
||||
func (o *CreateFavoriteParams) WithTimeout(timeout time.Duration) *CreateFavoriteParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the create favorite params
|
||||
func (o *CreateFavoriteParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the create favorite params
|
||||
func (o *CreateFavoriteParams) WithContext(ctx context.Context) *CreateFavoriteParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the create favorite params
|
||||
func (o *CreateFavoriteParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the create favorite params
|
||||
func (o *CreateFavoriteParams) WithHTTPClient(client *http.Client) *CreateFavoriteParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the create favorite params
|
||||
func (o *CreateFavoriteParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithFavoriteRequest adds the favoriteRequest to the create favorite params
|
||||
func (o *CreateFavoriteParams) WithFavoriteRequest(favoriteRequest *members_models.FavoriteRequest) *CreateFavoriteParams {
|
||||
o.SetFavoriteRequest(favoriteRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetFavoriteRequest adds the favoriteRequest to the create favorite params
|
||||
func (o *CreateFavoriteParams) SetFavoriteRequest(favoriteRequest *members_models.FavoriteRequest) {
|
||||
o.FavoriteRequest = favoriteRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *CreateFavoriteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.FavoriteRequest != nil {
|
||||
if err := r.SetBodyParam(o.FavoriteRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 favorites
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// CreateFavoriteReader is a Reader for the CreateFavorite structure.
|
||||
type CreateFavoriteReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *CreateFavoriteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 201:
|
||||
result := NewCreateFavoriteCreated()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateFavoriteCreated creates a CreateFavoriteCreated with default headers values
|
||||
func NewCreateFavoriteCreated() *CreateFavoriteCreated {
|
||||
return &CreateFavoriteCreated{}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateFavoriteCreated describes a response with status code 201, with default header values.
|
||||
|
||||
Created
|
||||
*/
|
||||
type CreateFavoriteCreated struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this create favorite created response has a 2xx status code
|
||||
func (o *CreateFavoriteCreated) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this create favorite created response has a 3xx status code
|
||||
func (o *CreateFavoriteCreated) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this create favorite created response has a 4xx status code
|
||||
func (o *CreateFavoriteCreated) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this create favorite created response has a 5xx status code
|
||||
func (o *CreateFavoriteCreated) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this create favorite created response a status code equal to that given
|
||||
func (o *CreateFavoriteCreated) IsCode(code int) bool {
|
||||
return code == 201
|
||||
}
|
||||
|
||||
// Code gets the status code for the create favorite created response
|
||||
func (o *CreateFavoriteCreated) Code() int {
|
||||
return 201
|
||||
}
|
||||
|
||||
func (o *CreateFavoriteCreated) Error() string {
|
||||
return fmt.Sprintf("[POST /favorites][%d] createFavoriteCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *CreateFavoriteCreated) String() string {
|
||||
return fmt.Sprintf("[POST /favorites][%d] createFavoriteCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *CreateFavoriteCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -34,59 +34,21 @@ type ClientOption func(*runtime.ClientOperation)
|
|||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
CreateFavorite(params *CreateFavoriteParams, opts ...ClientOption) (*CreateFavoriteCreated, error)
|
||||
DeleteFavorite(params *DeleteFavoriteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteFavoriteNoContent, error)
|
||||
|
||||
DeleteFavorite(params *DeleteFavoriteParams, opts ...ClientOption) (*DeleteFavoriteNoContent, error)
|
||||
GetFavorites(params *GetFavoritesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetFavoritesOK, error)
|
||||
|
||||
GetFavorites(params *GetFavoritesParams, opts ...ClientOption) (*GetFavoritesOK, error)
|
||||
PostFavorite(params *PostFavoriteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostFavoriteCreated, error)
|
||||
|
||||
UpdateFavorite(params *UpdateFavoriteParams, opts ...ClientOption) (*UpdateFavoriteOK, error)
|
||||
UpdateFavorite(params *UpdateFavoriteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateFavoriteOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
CreateFavorite creates a new favorite
|
||||
*/
|
||||
func (a *Client) CreateFavorite(params *CreateFavoriteParams, opts ...ClientOption) (*CreateFavoriteCreated, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewCreateFavoriteParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "createFavorite",
|
||||
Method: "POST",
|
||||
PathPattern: "/favorites",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &CreateFavoriteReader{formats: a.formats},
|
||||
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.(*CreateFavoriteCreated)
|
||||
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 createFavorite: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteFavorite deletes a favorite
|
||||
*/
|
||||
func (a *Client) DeleteFavorite(params *DeleteFavoriteParams, opts ...ClientOption) (*DeleteFavoriteNoContent, error) {
|
||||
func (a *Client) DeleteFavorite(params *DeleteFavoriteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteFavoriteNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteFavoriteParams()
|
||||
|
|
@ -100,6 +62,7 @@ func (a *Client) DeleteFavorite(params *DeleteFavoriteParams, opts ...ClientOpti
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteFavoriteReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
@ -124,7 +87,7 @@ func (a *Client) DeleteFavorite(params *DeleteFavoriteParams, opts ...ClientOpti
|
|||
/*
|
||||
GetFavorites gets a list of favorites
|
||||
*/
|
||||
func (a *Client) GetFavorites(params *GetFavoritesParams, opts ...ClientOption) (*GetFavoritesOK, error) {
|
||||
func (a *Client) GetFavorites(params *GetFavoritesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetFavoritesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetFavoritesParams()
|
||||
|
|
@ -138,6 +101,7 @@ func (a *Client) GetFavorites(params *GetFavoritesParams, opts ...ClientOption)
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetFavoritesReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
@ -159,10 +123,49 @@ func (a *Client) GetFavorites(params *GetFavoritesParams, opts ...ClientOption)
|
|||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostFavorite creates a new favorite
|
||||
*/
|
||||
func (a *Client) PostFavorite(params *PostFavoriteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostFavoriteCreated, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostFavoriteParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postFavorite",
|
||||
Method: "POST",
|
||||
PathPattern: "/favorites",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostFavoriteReader{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.(*PostFavoriteCreated)
|
||||
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 postFavorite: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateFavorite updates an existing favorite
|
||||
*/
|
||||
func (a *Client) UpdateFavorite(params *UpdateFavoriteParams, opts ...ClientOption) (*UpdateFavoriteOK, error) {
|
||||
func (a *Client) UpdateFavorite(params *UpdateFavoriteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateFavoriteOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewUpdateFavoriteParams()
|
||||
|
|
@ -176,6 +179,7 @@ func (a *Client) UpdateFavorite(params *UpdateFavoriteParams, opts ...ClientOpti
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &UpdateFavoriteReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 favorites
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewPostFavoriteParams creates a new PostFavoriteParams 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 NewPostFavoriteParams() *PostFavoriteParams {
|
||||
return &PostFavoriteParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostFavoriteParamsWithTimeout creates a new PostFavoriteParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostFavoriteParamsWithTimeout(timeout time.Duration) *PostFavoriteParams {
|
||||
return &PostFavoriteParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostFavoriteParamsWithContext creates a new PostFavoriteParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostFavoriteParamsWithContext(ctx context.Context) *PostFavoriteParams {
|
||||
return &PostFavoriteParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostFavoriteParamsWithHTTPClient creates a new PostFavoriteParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostFavoriteParamsWithHTTPClient(client *http.Client) *PostFavoriteParams {
|
||||
return &PostFavoriteParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostFavoriteParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post favorite operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostFavoriteParams struct {
|
||||
|
||||
/* FavoriteRequest.
|
||||
|
||||
An array of new Favorite records
|
||||
*/
|
||||
FavoriteRequest *members_models.FavoriteRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post favorite params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostFavoriteParams) WithDefaults() *PostFavoriteParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post favorite params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostFavoriteParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post favorite params
|
||||
func (o *PostFavoriteParams) WithTimeout(timeout time.Duration) *PostFavoriteParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post favorite params
|
||||
func (o *PostFavoriteParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post favorite params
|
||||
func (o *PostFavoriteParams) WithContext(ctx context.Context) *PostFavoriteParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post favorite params
|
||||
func (o *PostFavoriteParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post favorite params
|
||||
func (o *PostFavoriteParams) WithHTTPClient(client *http.Client) *PostFavoriteParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post favorite params
|
||||
func (o *PostFavoriteParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithFavoriteRequest adds the favoriteRequest to the post favorite params
|
||||
func (o *PostFavoriteParams) WithFavoriteRequest(favoriteRequest *members_models.FavoriteRequest) *PostFavoriteParams {
|
||||
o.SetFavoriteRequest(favoriteRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetFavoriteRequest adds the favoriteRequest to the post favorite params
|
||||
func (o *PostFavoriteParams) SetFavoriteRequest(favoriteRequest *members_models.FavoriteRequest) {
|
||||
o.FavoriteRequest = favoriteRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostFavoriteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.FavoriteRequest != nil {
|
||||
if err := r.SetBodyParam(o.FavoriteRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
// 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 favorites
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// PostFavoriteReader is a Reader for the PostFavorite structure.
|
||||
type PostFavoriteReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostFavoriteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 201:
|
||||
result := NewPostFavoriteCreated()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostFavoriteCreated creates a PostFavoriteCreated with default headers values
|
||||
func NewPostFavoriteCreated() *PostFavoriteCreated {
|
||||
return &PostFavoriteCreated{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostFavoriteCreated describes a response with status code 201, with default header values.
|
||||
|
||||
Created
|
||||
*/
|
||||
type PostFavoriteCreated struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post favorite created response has a 2xx status code
|
||||
func (o *PostFavoriteCreated) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post favorite created response has a 3xx status code
|
||||
func (o *PostFavoriteCreated) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post favorite created response has a 4xx status code
|
||||
func (o *PostFavoriteCreated) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post favorite created response has a 5xx status code
|
||||
func (o *PostFavoriteCreated) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post favorite created response a status code equal to that given
|
||||
func (o *PostFavoriteCreated) IsCode(code int) bool {
|
||||
return code == 201
|
||||
}
|
||||
|
||||
// Code gets the status code for the post favorite created response
|
||||
func (o *PostFavoriteCreated) Code() int {
|
||||
return 201
|
||||
}
|
||||
|
||||
func (o *PostFavoriteCreated) Error() string {
|
||||
return fmt.Sprintf("[POST /favorites][%d] postFavoriteCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *PostFavoriteCreated) String() string {
|
||||
return fmt.Sprintf("[POST /favorites][%d] postFavoriteCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *PostFavoriteCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,157 +0,0 @@
|
|||
// 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 invoices
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewCreateInvoiceParams creates a new CreateInvoiceParams 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 NewCreateInvoiceParams() *CreateInvoiceParams {
|
||||
return &CreateInvoiceParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateInvoiceParamsWithTimeout creates a new CreateInvoiceParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewCreateInvoiceParamsWithTimeout(timeout time.Duration) *CreateInvoiceParams {
|
||||
return &CreateInvoiceParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateInvoiceParamsWithContext creates a new CreateInvoiceParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewCreateInvoiceParamsWithContext(ctx context.Context) *CreateInvoiceParams {
|
||||
return &CreateInvoiceParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateInvoiceParamsWithHTTPClient creates a new CreateInvoiceParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewCreateInvoiceParamsWithHTTPClient(client *http.Client) *CreateInvoiceParams {
|
||||
return &CreateInvoiceParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateInvoiceParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the create invoice operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type CreateInvoiceParams struct {
|
||||
|
||||
/* InvoiceRequest.
|
||||
|
||||
An array of new Invoice records
|
||||
*/
|
||||
InvoiceRequest *members_models.InvoiceRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the create invoice params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *CreateInvoiceParams) WithDefaults() *CreateInvoiceParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the create invoice params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *CreateInvoiceParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the create invoice params
|
||||
func (o *CreateInvoiceParams) WithTimeout(timeout time.Duration) *CreateInvoiceParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the create invoice params
|
||||
func (o *CreateInvoiceParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the create invoice params
|
||||
func (o *CreateInvoiceParams) WithContext(ctx context.Context) *CreateInvoiceParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the create invoice params
|
||||
func (o *CreateInvoiceParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the create invoice params
|
||||
func (o *CreateInvoiceParams) WithHTTPClient(client *http.Client) *CreateInvoiceParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the create invoice params
|
||||
func (o *CreateInvoiceParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithInvoiceRequest adds the invoiceRequest to the create invoice params
|
||||
func (o *CreateInvoiceParams) WithInvoiceRequest(invoiceRequest *members_models.InvoiceRequest) *CreateInvoiceParams {
|
||||
o.SetInvoiceRequest(invoiceRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetInvoiceRequest adds the invoiceRequest to the create invoice params
|
||||
func (o *CreateInvoiceParams) SetInvoiceRequest(invoiceRequest *members_models.InvoiceRequest) {
|
||||
o.InvoiceRequest = invoiceRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *CreateInvoiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.InvoiceRequest != nil {
|
||||
if err := r.SetBodyParam(o.InvoiceRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 invoices
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// CreateInvoiceReader is a Reader for the CreateInvoice structure.
|
||||
type CreateInvoiceReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *CreateInvoiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 201:
|
||||
result := NewCreateInvoiceCreated()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateInvoiceCreated creates a CreateInvoiceCreated with default headers values
|
||||
func NewCreateInvoiceCreated() *CreateInvoiceCreated {
|
||||
return &CreateInvoiceCreated{}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateInvoiceCreated describes a response with status code 201, with default header values.
|
||||
|
||||
Created
|
||||
*/
|
||||
type CreateInvoiceCreated struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this create invoice created response has a 2xx status code
|
||||
func (o *CreateInvoiceCreated) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this create invoice created response has a 3xx status code
|
||||
func (o *CreateInvoiceCreated) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this create invoice created response has a 4xx status code
|
||||
func (o *CreateInvoiceCreated) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this create invoice created response has a 5xx status code
|
||||
func (o *CreateInvoiceCreated) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this create invoice created response a status code equal to that given
|
||||
func (o *CreateInvoiceCreated) IsCode(code int) bool {
|
||||
return code == 201
|
||||
}
|
||||
|
||||
// Code gets the status code for the create invoice created response
|
||||
func (o *CreateInvoiceCreated) Code() int {
|
||||
return 201
|
||||
}
|
||||
|
||||
func (o *CreateInvoiceCreated) Error() string {
|
||||
return fmt.Sprintf("[POST /invoices][%d] createInvoiceCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *CreateInvoiceCreated) String() string {
|
||||
return fmt.Sprintf("[POST /invoices][%d] createInvoiceCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *CreateInvoiceCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -34,59 +34,21 @@ type ClientOption func(*runtime.ClientOperation)
|
|||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
CreateInvoice(params *CreateInvoiceParams, opts ...ClientOption) (*CreateInvoiceCreated, error)
|
||||
DeleteInvoice(params *DeleteInvoiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteInvoiceNoContent, error)
|
||||
|
||||
DeleteInvoice(params *DeleteInvoiceParams, opts ...ClientOption) (*DeleteInvoiceNoContent, error)
|
||||
GetInvoices(params *GetInvoicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetInvoicesOK, error)
|
||||
|
||||
GetInvoices(params *GetInvoicesParams, opts ...ClientOption) (*GetInvoicesOK, error)
|
||||
PostInvoice(params *PostInvoiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostInvoiceCreated, error)
|
||||
|
||||
UpdateInvoice(params *UpdateInvoiceParams, opts ...ClientOption) (*UpdateInvoiceOK, error)
|
||||
UpdateInvoice(params *UpdateInvoiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateInvoiceOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
CreateInvoice creates a new invoice
|
||||
*/
|
||||
func (a *Client) CreateInvoice(params *CreateInvoiceParams, opts ...ClientOption) (*CreateInvoiceCreated, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewCreateInvoiceParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "createInvoice",
|
||||
Method: "POST",
|
||||
PathPattern: "/invoices",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &CreateInvoiceReader{formats: a.formats},
|
||||
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.(*CreateInvoiceCreated)
|
||||
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 createInvoice: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteInvoice deletes a invoice
|
||||
*/
|
||||
func (a *Client) DeleteInvoice(params *DeleteInvoiceParams, opts ...ClientOption) (*DeleteInvoiceNoContent, error) {
|
||||
func (a *Client) DeleteInvoice(params *DeleteInvoiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteInvoiceNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteInvoiceParams()
|
||||
|
|
@ -100,6 +62,7 @@ func (a *Client) DeleteInvoice(params *DeleteInvoiceParams, opts ...ClientOption
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteInvoiceReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
@ -124,7 +87,7 @@ func (a *Client) DeleteInvoice(params *DeleteInvoiceParams, opts ...ClientOption
|
|||
/*
|
||||
GetInvoices gets a list of invoices
|
||||
*/
|
||||
func (a *Client) GetInvoices(params *GetInvoicesParams, opts ...ClientOption) (*GetInvoicesOK, error) {
|
||||
func (a *Client) GetInvoices(params *GetInvoicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetInvoicesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetInvoicesParams()
|
||||
|
|
@ -138,6 +101,7 @@ func (a *Client) GetInvoices(params *GetInvoicesParams, opts ...ClientOption) (*
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetInvoicesReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
@ -159,10 +123,49 @@ func (a *Client) GetInvoices(params *GetInvoicesParams, opts ...ClientOption) (*
|
|||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostInvoice creates a new invoice
|
||||
*/
|
||||
func (a *Client) PostInvoice(params *PostInvoiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostInvoiceCreated, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostInvoiceParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postInvoice",
|
||||
Method: "POST",
|
||||
PathPattern: "/invoices",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostInvoiceReader{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.(*PostInvoiceCreated)
|
||||
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 postInvoice: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateInvoice updates an existing invoice
|
||||
*/
|
||||
func (a *Client) UpdateInvoice(params *UpdateInvoiceParams, opts ...ClientOption) (*UpdateInvoiceOK, error) {
|
||||
func (a *Client) UpdateInvoice(params *UpdateInvoiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateInvoiceOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewUpdateInvoiceParams()
|
||||
|
|
@ -176,6 +179,7 @@ func (a *Client) UpdateInvoice(params *UpdateInvoiceParams, opts ...ClientOption
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &UpdateInvoiceReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 invoices
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewPostInvoiceParams creates a new PostInvoiceParams 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 NewPostInvoiceParams() *PostInvoiceParams {
|
||||
return &PostInvoiceParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostInvoiceParamsWithTimeout creates a new PostInvoiceParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostInvoiceParamsWithTimeout(timeout time.Duration) *PostInvoiceParams {
|
||||
return &PostInvoiceParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostInvoiceParamsWithContext creates a new PostInvoiceParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostInvoiceParamsWithContext(ctx context.Context) *PostInvoiceParams {
|
||||
return &PostInvoiceParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostInvoiceParamsWithHTTPClient creates a new PostInvoiceParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostInvoiceParamsWithHTTPClient(client *http.Client) *PostInvoiceParams {
|
||||
return &PostInvoiceParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostInvoiceParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post invoice operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostInvoiceParams struct {
|
||||
|
||||
/* InvoiceRequest.
|
||||
|
||||
An array of new Invoice records
|
||||
*/
|
||||
InvoiceRequest *members_models.InvoiceRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post invoice params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostInvoiceParams) WithDefaults() *PostInvoiceParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post invoice params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostInvoiceParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post invoice params
|
||||
func (o *PostInvoiceParams) WithTimeout(timeout time.Duration) *PostInvoiceParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post invoice params
|
||||
func (o *PostInvoiceParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post invoice params
|
||||
func (o *PostInvoiceParams) WithContext(ctx context.Context) *PostInvoiceParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post invoice params
|
||||
func (o *PostInvoiceParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post invoice params
|
||||
func (o *PostInvoiceParams) WithHTTPClient(client *http.Client) *PostInvoiceParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post invoice params
|
||||
func (o *PostInvoiceParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithInvoiceRequest adds the invoiceRequest to the post invoice params
|
||||
func (o *PostInvoiceParams) WithInvoiceRequest(invoiceRequest *members_models.InvoiceRequest) *PostInvoiceParams {
|
||||
o.SetInvoiceRequest(invoiceRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetInvoiceRequest adds the invoiceRequest to the post invoice params
|
||||
func (o *PostInvoiceParams) SetInvoiceRequest(invoiceRequest *members_models.InvoiceRequest) {
|
||||
o.InvoiceRequest = invoiceRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostInvoiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.InvoiceRequest != nil {
|
||||
if err := r.SetBodyParam(o.InvoiceRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
// 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 invoices
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// PostInvoiceReader is a Reader for the PostInvoice structure.
|
||||
type PostInvoiceReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostInvoiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 201:
|
||||
result := NewPostInvoiceCreated()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostInvoiceCreated creates a PostInvoiceCreated with default headers values
|
||||
func NewPostInvoiceCreated() *PostInvoiceCreated {
|
||||
return &PostInvoiceCreated{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostInvoiceCreated describes a response with status code 201, with default header values.
|
||||
|
||||
Created
|
||||
*/
|
||||
type PostInvoiceCreated struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post invoice created response has a 2xx status code
|
||||
func (o *PostInvoiceCreated) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post invoice created response has a 3xx status code
|
||||
func (o *PostInvoiceCreated) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post invoice created response has a 4xx status code
|
||||
func (o *PostInvoiceCreated) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post invoice created response has a 5xx status code
|
||||
func (o *PostInvoiceCreated) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post invoice created response a status code equal to that given
|
||||
func (o *PostInvoiceCreated) IsCode(code int) bool {
|
||||
return code == 201
|
||||
}
|
||||
|
||||
// Code gets the status code for the post invoice created response
|
||||
func (o *PostInvoiceCreated) Code() int {
|
||||
return 201
|
||||
}
|
||||
|
||||
func (o *PostInvoiceCreated) Error() string {
|
||||
return fmt.Sprintf("[POST /invoices][%d] postInvoiceCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *PostInvoiceCreated) String() string {
|
||||
return fmt.Sprintf("[POST /invoices][%d] postInvoiceCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *PostInvoiceCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,157 +0,0 @@
|
|||
// 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 issued_certificates
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewCreateIssuedCertificateParams creates a new CreateIssuedCertificateParams 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 NewCreateIssuedCertificateParams() *CreateIssuedCertificateParams {
|
||||
return &CreateIssuedCertificateParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateIssuedCertificateParamsWithTimeout creates a new CreateIssuedCertificateParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewCreateIssuedCertificateParamsWithTimeout(timeout time.Duration) *CreateIssuedCertificateParams {
|
||||
return &CreateIssuedCertificateParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateIssuedCertificateParamsWithContext creates a new CreateIssuedCertificateParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewCreateIssuedCertificateParamsWithContext(ctx context.Context) *CreateIssuedCertificateParams {
|
||||
return &CreateIssuedCertificateParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateIssuedCertificateParamsWithHTTPClient creates a new CreateIssuedCertificateParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewCreateIssuedCertificateParamsWithHTTPClient(client *http.Client) *CreateIssuedCertificateParams {
|
||||
return &CreateIssuedCertificateParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateIssuedCertificateParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the create issued certificate operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type CreateIssuedCertificateParams struct {
|
||||
|
||||
/* IssuedcertificateRequest.
|
||||
|
||||
An array of new IssuedCertificate records
|
||||
*/
|
||||
IssuedcertificateRequest *members_models.IssuedCertificateRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the create issued certificate params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *CreateIssuedCertificateParams) WithDefaults() *CreateIssuedCertificateParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the create issued certificate params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *CreateIssuedCertificateParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the create issued certificate params
|
||||
func (o *CreateIssuedCertificateParams) WithTimeout(timeout time.Duration) *CreateIssuedCertificateParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the create issued certificate params
|
||||
func (o *CreateIssuedCertificateParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the create issued certificate params
|
||||
func (o *CreateIssuedCertificateParams) WithContext(ctx context.Context) *CreateIssuedCertificateParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the create issued certificate params
|
||||
func (o *CreateIssuedCertificateParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the create issued certificate params
|
||||
func (o *CreateIssuedCertificateParams) WithHTTPClient(client *http.Client) *CreateIssuedCertificateParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the create issued certificate params
|
||||
func (o *CreateIssuedCertificateParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithIssuedcertificateRequest adds the issuedcertificateRequest to the create issued certificate params
|
||||
func (o *CreateIssuedCertificateParams) WithIssuedcertificateRequest(issuedcertificateRequest *members_models.IssuedCertificateRequest) *CreateIssuedCertificateParams {
|
||||
o.SetIssuedcertificateRequest(issuedcertificateRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetIssuedcertificateRequest adds the issuedcertificateRequest to the create issued certificate params
|
||||
func (o *CreateIssuedCertificateParams) SetIssuedcertificateRequest(issuedcertificateRequest *members_models.IssuedCertificateRequest) {
|
||||
o.IssuedcertificateRequest = issuedcertificateRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *CreateIssuedCertificateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.IssuedcertificateRequest != nil {
|
||||
if err := r.SetBodyParam(o.IssuedcertificateRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 issued_certificates
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// CreateIssuedCertificateReader is a Reader for the CreateIssuedCertificate structure.
|
||||
type CreateIssuedCertificateReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *CreateIssuedCertificateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 201:
|
||||
result := NewCreateIssuedCertificateCreated()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateIssuedCertificateCreated creates a CreateIssuedCertificateCreated with default headers values
|
||||
func NewCreateIssuedCertificateCreated() *CreateIssuedCertificateCreated {
|
||||
return &CreateIssuedCertificateCreated{}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateIssuedCertificateCreated describes a response with status code 201, with default header values.
|
||||
|
||||
Created
|
||||
*/
|
||||
type CreateIssuedCertificateCreated struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this create issued certificate created response has a 2xx status code
|
||||
func (o *CreateIssuedCertificateCreated) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this create issued certificate created response has a 3xx status code
|
||||
func (o *CreateIssuedCertificateCreated) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this create issued certificate created response has a 4xx status code
|
||||
func (o *CreateIssuedCertificateCreated) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this create issued certificate created response has a 5xx status code
|
||||
func (o *CreateIssuedCertificateCreated) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this create issued certificate created response a status code equal to that given
|
||||
func (o *CreateIssuedCertificateCreated) IsCode(code int) bool {
|
||||
return code == 201
|
||||
}
|
||||
|
||||
// Code gets the status code for the create issued certificate created response
|
||||
func (o *CreateIssuedCertificateCreated) Code() int {
|
||||
return 201
|
||||
}
|
||||
|
||||
func (o *CreateIssuedCertificateCreated) Error() string {
|
||||
return fmt.Sprintf("[POST /issuedcertificates][%d] createIssuedCertificateCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *CreateIssuedCertificateCreated) String() string {
|
||||
return fmt.Sprintf("[POST /issuedcertificates][%d] createIssuedCertificateCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *CreateIssuedCertificateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -34,59 +34,21 @@ type ClientOption func(*runtime.ClientOperation)
|
|||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
CreateIssuedCertificate(params *CreateIssuedCertificateParams, opts ...ClientOption) (*CreateIssuedCertificateCreated, error)
|
||||
DeleteIssuedCertificate(params *DeleteIssuedCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIssuedCertificateNoContent, error)
|
||||
|
||||
DeleteIssuedCertificate(params *DeleteIssuedCertificateParams, opts ...ClientOption) (*DeleteIssuedCertificateNoContent, error)
|
||||
GetIssuedCertificates(params *GetIssuedCertificatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIssuedCertificatesOK, error)
|
||||
|
||||
GetIssuedCertificates(params *GetIssuedCertificatesParams, opts ...ClientOption) (*GetIssuedCertificatesOK, error)
|
||||
PostIssuedCertificate(params *PostIssuedCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostIssuedCertificateCreated, error)
|
||||
|
||||
UpdateIssuedCertificate(params *UpdateIssuedCertificateParams, opts ...ClientOption) (*UpdateIssuedCertificateOK, error)
|
||||
UpdateIssuedCertificate(params *UpdateIssuedCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIssuedCertificateOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
CreateIssuedCertificate creates a new issued certificate
|
||||
*/
|
||||
func (a *Client) CreateIssuedCertificate(params *CreateIssuedCertificateParams, opts ...ClientOption) (*CreateIssuedCertificateCreated, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewCreateIssuedCertificateParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "createIssuedCertificate",
|
||||
Method: "POST",
|
||||
PathPattern: "/issuedcertificates",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &CreateIssuedCertificateReader{formats: a.formats},
|
||||
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.(*CreateIssuedCertificateCreated)
|
||||
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 createIssuedCertificate: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteIssuedCertificate deletes a issued certificate
|
||||
*/
|
||||
func (a *Client) DeleteIssuedCertificate(params *DeleteIssuedCertificateParams, opts ...ClientOption) (*DeleteIssuedCertificateNoContent, error) {
|
||||
func (a *Client) DeleteIssuedCertificate(params *DeleteIssuedCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIssuedCertificateNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteIssuedCertificateParams()
|
||||
|
|
@ -100,6 +62,7 @@ func (a *Client) DeleteIssuedCertificate(params *DeleteIssuedCertificateParams,
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteIssuedCertificateReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
@ -124,7 +87,7 @@ func (a *Client) DeleteIssuedCertificate(params *DeleteIssuedCertificateParams,
|
|||
/*
|
||||
GetIssuedCertificates gets a list of issued certificates
|
||||
*/
|
||||
func (a *Client) GetIssuedCertificates(params *GetIssuedCertificatesParams, opts ...ClientOption) (*GetIssuedCertificatesOK, error) {
|
||||
func (a *Client) GetIssuedCertificates(params *GetIssuedCertificatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIssuedCertificatesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetIssuedCertificatesParams()
|
||||
|
|
@ -138,6 +101,7 @@ func (a *Client) GetIssuedCertificates(params *GetIssuedCertificatesParams, opts
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetIssuedCertificatesReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
@ -159,10 +123,49 @@ func (a *Client) GetIssuedCertificates(params *GetIssuedCertificatesParams, opts
|
|||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostIssuedCertificate creates a new issued certificate
|
||||
*/
|
||||
func (a *Client) PostIssuedCertificate(params *PostIssuedCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostIssuedCertificateCreated, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostIssuedCertificateParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postIssuedCertificate",
|
||||
Method: "POST",
|
||||
PathPattern: "/issuedcertificates",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostIssuedCertificateReader{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.(*PostIssuedCertificateCreated)
|
||||
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 postIssuedCertificate: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateIssuedCertificate updates an existing issued certificate
|
||||
*/
|
||||
func (a *Client) UpdateIssuedCertificate(params *UpdateIssuedCertificateParams, opts ...ClientOption) (*UpdateIssuedCertificateOK, error) {
|
||||
func (a *Client) UpdateIssuedCertificate(params *UpdateIssuedCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIssuedCertificateOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewUpdateIssuedCertificateParams()
|
||||
|
|
@ -176,6 +179,7 @@ func (a *Client) UpdateIssuedCertificate(params *UpdateIssuedCertificateParams,
|
|||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &UpdateIssuedCertificateReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 issued_certificates
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewPostIssuedCertificateParams creates a new PostIssuedCertificateParams 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 NewPostIssuedCertificateParams() *PostIssuedCertificateParams {
|
||||
return &PostIssuedCertificateParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostIssuedCertificateParamsWithTimeout creates a new PostIssuedCertificateParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostIssuedCertificateParamsWithTimeout(timeout time.Duration) *PostIssuedCertificateParams {
|
||||
return &PostIssuedCertificateParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostIssuedCertificateParamsWithContext creates a new PostIssuedCertificateParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostIssuedCertificateParamsWithContext(ctx context.Context) *PostIssuedCertificateParams {
|
||||
return &PostIssuedCertificateParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostIssuedCertificateParamsWithHTTPClient creates a new PostIssuedCertificateParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostIssuedCertificateParamsWithHTTPClient(client *http.Client) *PostIssuedCertificateParams {
|
||||
return &PostIssuedCertificateParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostIssuedCertificateParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post issued certificate operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostIssuedCertificateParams struct {
|
||||
|
||||
/* IssuedcertificateRequest.
|
||||
|
||||
An array of new IssuedCertificate records
|
||||
*/
|
||||
IssuedcertificateRequest *members_models.IssuedCertificateRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post issued certificate params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostIssuedCertificateParams) WithDefaults() *PostIssuedCertificateParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post issued certificate params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostIssuedCertificateParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post issued certificate params
|
||||
func (o *PostIssuedCertificateParams) WithTimeout(timeout time.Duration) *PostIssuedCertificateParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post issued certificate params
|
||||
func (o *PostIssuedCertificateParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post issued certificate params
|
||||
func (o *PostIssuedCertificateParams) WithContext(ctx context.Context) *PostIssuedCertificateParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post issued certificate params
|
||||
func (o *PostIssuedCertificateParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post issued certificate params
|
||||
func (o *PostIssuedCertificateParams) WithHTTPClient(client *http.Client) *PostIssuedCertificateParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post issued certificate params
|
||||
func (o *PostIssuedCertificateParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithIssuedcertificateRequest adds the issuedcertificateRequest to the post issued certificate params
|
||||
func (o *PostIssuedCertificateParams) WithIssuedcertificateRequest(issuedcertificateRequest *members_models.IssuedCertificateRequest) *PostIssuedCertificateParams {
|
||||
o.SetIssuedcertificateRequest(issuedcertificateRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetIssuedcertificateRequest adds the issuedcertificateRequest to the post issued certificate params
|
||||
func (o *PostIssuedCertificateParams) SetIssuedcertificateRequest(issuedcertificateRequest *members_models.IssuedCertificateRequest) {
|
||||
o.IssuedcertificateRequest = issuedcertificateRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostIssuedCertificateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.IssuedcertificateRequest != nil {
|
||||
if err := r.SetBodyParam(o.IssuedcertificateRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
// 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 issued_certificates
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// PostIssuedCertificateReader is a Reader for the PostIssuedCertificate structure.
|
||||
type PostIssuedCertificateReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostIssuedCertificateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 201:
|
||||
result := NewPostIssuedCertificateCreated()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostIssuedCertificateCreated creates a PostIssuedCertificateCreated with default headers values
|
||||
func NewPostIssuedCertificateCreated() *PostIssuedCertificateCreated {
|
||||
return &PostIssuedCertificateCreated{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostIssuedCertificateCreated describes a response with status code 201, with default header values.
|
||||
|
||||
Created
|
||||
*/
|
||||
type PostIssuedCertificateCreated struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post issued certificate created response has a 2xx status code
|
||||
func (o *PostIssuedCertificateCreated) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post issued certificate created response has a 3xx status code
|
||||
func (o *PostIssuedCertificateCreated) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post issued certificate created response has a 4xx status code
|
||||
func (o *PostIssuedCertificateCreated) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post issued certificate created response has a 5xx status code
|
||||
func (o *PostIssuedCertificateCreated) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post issued certificate created response a status code equal to that given
|
||||
func (o *PostIssuedCertificateCreated) IsCode(code int) bool {
|
||||
return code == 201
|
||||
}
|
||||
|
||||
// Code gets the status code for the post issued certificate created response
|
||||
func (o *PostIssuedCertificateCreated) Code() int {
|
||||
return 201
|
||||
}
|
||||
|
||||
func (o *PostIssuedCertificateCreated) Error() string {
|
||||
return fmt.Sprintf("[POST /issuedcertificates][%d] postIssuedCertificateCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *PostIssuedCertificateCreated) String() string {
|
||||
return fmt.Sprintf("[POST /issuedcertificates][%d] postIssuedCertificateCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *PostIssuedCertificateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,157 +0,0 @@
|
|||
// 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 lesson_progress
|
||||
|
||||
// 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/members/members_models"
|
||||
)
|
||||
|
||||
// NewCreateLessonProgressParams creates a new CreateLessonProgressParams 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 NewCreateLessonProgressParams() *CreateLessonProgressParams {
|
||||
return &CreateLessonProgressParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateLessonProgressParamsWithTimeout creates a new CreateLessonProgressParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewCreateLessonProgressParamsWithTimeout(timeout time.Duration) *CreateLessonProgressParams {
|
||||
return &CreateLessonProgressParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateLessonProgressParamsWithContext creates a new CreateLessonProgressParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewCreateLessonProgressParamsWithContext(ctx context.Context) *CreateLessonProgressParams {
|
||||
return &CreateLessonProgressParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateLessonProgressParamsWithHTTPClient creates a new CreateLessonProgressParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewCreateLessonProgressParamsWithHTTPClient(client *http.Client) *CreateLessonProgressParams {
|
||||
return &CreateLessonProgressParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateLessonProgressParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the create lesson progress operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type CreateLessonProgressParams struct {
|
||||
|
||||
/* LessonprogressRequest.
|
||||
|
||||
An array of new LessonProgress records
|
||||
*/
|
||||
LessonprogressRequest *members_models.LessonProgressRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the create lesson progress params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *CreateLessonProgressParams) WithDefaults() *CreateLessonProgressParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the create lesson progress params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *CreateLessonProgressParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the create lesson progress params
|
||||
func (o *CreateLessonProgressParams) WithTimeout(timeout time.Duration) *CreateLessonProgressParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the create lesson progress params
|
||||
func (o *CreateLessonProgressParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the create lesson progress params
|
||||
func (o *CreateLessonProgressParams) WithContext(ctx context.Context) *CreateLessonProgressParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the create lesson progress params
|
||||
func (o *CreateLessonProgressParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the create lesson progress params
|
||||
func (o *CreateLessonProgressParams) WithHTTPClient(client *http.Client) *CreateLessonProgressParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the create lesson progress params
|
||||
func (o *CreateLessonProgressParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithLessonprogressRequest adds the lessonprogressRequest to the create lesson progress params
|
||||
func (o *CreateLessonProgressParams) WithLessonprogressRequest(lessonprogressRequest *members_models.LessonProgressRequest) *CreateLessonProgressParams {
|
||||
o.SetLessonprogressRequest(lessonprogressRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLessonprogressRequest adds the lessonprogressRequest to the create lesson progress params
|
||||
func (o *CreateLessonProgressParams) SetLessonprogressRequest(lessonprogressRequest *members_models.LessonProgressRequest) {
|
||||
o.LessonprogressRequest = lessonprogressRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *CreateLessonProgressParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.LessonprogressRequest != nil {
|
||||
if err := r.SetBodyParam(o.LessonprogressRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// 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 lesson_progress
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// CreateLessonProgressReader is a Reader for the CreateLessonProgress structure.
|
||||
type CreateLessonProgressReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *CreateLessonProgressReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 201:
|
||||
result := NewCreateLessonProgressCreated()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewCreateLessonProgressCreated creates a CreateLessonProgressCreated with default headers values
|
||||
func NewCreateLessonProgressCreated() *CreateLessonProgressCreated {
|
||||
return &CreateLessonProgressCreated{}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateLessonProgressCreated describes a response with status code 201, with default header values.
|
||||
|
||||
Created
|
||||
*/
|
||||
type CreateLessonProgressCreated struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this create lesson progress created response has a 2xx status code
|
||||
func (o *CreateLessonProgressCreated) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this create lesson progress created response has a 3xx status code
|
||||
func (o *CreateLessonProgressCreated) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this create lesson progress created response has a 4xx status code
|
||||
func (o *CreateLessonProgressCreated) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this create lesson progress created response has a 5xx status code
|
||||
func (o *CreateLessonProgressCreated) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this create lesson progress created response a status code equal to that given
|
||||
func (o *CreateLessonProgressCreated) IsCode(code int) bool {
|
||||
return code == 201
|
||||
}
|
||||
|
||||
// Code gets the status code for the create lesson progress created response
|
||||
func (o *CreateLessonProgressCreated) Code() int {
|
||||
return 201
|
||||
}
|
||||
|
||||
func (o *CreateLessonProgressCreated) Error() string {
|
||||
return fmt.Sprintf("[POST /lessonprogress][%d] createLessonProgressCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *CreateLessonProgressCreated) String() string {
|
||||
return fmt.Sprintf("[POST /lessonprogress][%d] createLessonProgressCreated ", 201)
|
||||
}
|
||||
|
||||
func (o *CreateLessonProgressCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue