2022-07-26 21:38:35 +02:00
// Code generated by go-swagger; DO NOT EDIT.
2023-01-04 19:43:37 +01:00
package share
2022-07-26 21:38:35 +02:00
// 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"
)
2023-01-04 19:43:37 +01:00
// New creates a new share API client.
2022-07-26 21:38:35 +02:00
func New ( transport runtime . ClientTransport , formats strfmt . Registry ) ClientService {
return & Client { transport : transport , formats : formats }
}
/ *
2023-01-04 19:43:37 +01:00
Client for share API
2022-07-26 21:38:35 +02:00
* /
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 {
2022-11-23 18:12:11 +01:00
Access ( params * AccessParams , authInfo runtime . ClientAuthInfoWriter , opts ... ClientOption ) ( * AccessCreated , error )
2022-11-18 21:36:55 +01:00
Share ( params * ShareParams , authInfo runtime . ClientAuthInfoWriter , opts ... ClientOption ) ( * ShareCreated , error )
2022-07-26 21:38:35 +02:00
2022-11-23 18:12:11 +01:00
Unaccess ( params * UnaccessParams , authInfo runtime . ClientAuthInfoWriter , opts ... ClientOption ) ( * UnaccessOK , error )
2022-11-18 21:36:55 +01:00
Unshare ( params * UnshareParams , authInfo runtime . ClientAuthInfoWriter , opts ... ClientOption ) ( * UnshareOK , error )
2022-07-27 17:35:28 +02:00
2022-12-02 19:21:05 +01:00
UpdateShare ( params * UpdateShareParams , authInfo runtime . ClientAuthInfoWriter , opts ... ClientOption ) ( * UpdateShareOK , error )
2022-07-26 21:38:35 +02:00
SetTransport ( transport runtime . ClientTransport )
}
2022-11-23 18:12:11 +01:00
/ *
Access access API
* /
func ( a * Client ) Access ( params * AccessParams , authInfo runtime . ClientAuthInfoWriter , opts ... ClientOption ) ( * AccessCreated , error ) {
// TODO: Validate the params before sending
if params == nil {
params = NewAccessParams ( )
}
op := & runtime . ClientOperation {
ID : "access" ,
Method : "POST" ,
PathPattern : "/access" ,
ProducesMediaTypes : [ ] string { "application/zrok.v1+json" } ,
ConsumesMediaTypes : [ ] string { "application/zrok.v1+json" } ,
Schemes : [ ] string { "http" } ,
Params : params ,
Reader : & AccessReader { 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 . ( * AccessCreated )
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 access: API contract not enforced by server. Client expected to get an error, but got: %T" , result )
panic ( msg )
}
2022-07-26 21:38:35 +02:00
/ *
2022-11-18 21:36:55 +01:00
Share share API
2022-07-26 21:38:35 +02:00
* /
2022-11-18 21:36:55 +01:00
func ( a * Client ) Share ( params * ShareParams , authInfo runtime . ClientAuthInfoWriter , opts ... ClientOption ) ( * ShareCreated , error ) {
2022-07-26 21:38:35 +02:00
// TODO: Validate the params before sending
if params == nil {
2022-11-18 21:36:55 +01:00
params = NewShareParams ( )
2022-07-26 21:38:35 +02:00
}
op := & runtime . ClientOperation {
2022-11-18 21:36:55 +01:00
ID : "share" ,
2022-07-26 21:38:35 +02:00
Method : "POST" ,
2022-11-18 21:36:55 +01:00
PathPattern : "/share" ,
2022-07-26 21:38:35 +02:00
ProducesMediaTypes : [ ] string { "application/zrok.v1+json" } ,
ConsumesMediaTypes : [ ] string { "application/zrok.v1+json" } ,
Schemes : [ ] string { "http" } ,
Params : params ,
2022-11-18 21:36:55 +01:00
Reader : & ShareReader { formats : a . formats } ,
2022-07-28 20:32:49 +02:00
AuthInfo : authInfo ,
2022-07-26 21:38:35 +02:00
Context : params . Context ,
Client : params . HTTPClient ,
}
for _ , opt := range opts {
opt ( op )
}
result , err := a . transport . Submit ( op )
if err != nil {
return nil , err
}
2022-11-18 21:36:55 +01:00
success , ok := result . ( * ShareCreated )
2022-07-26 21:38:35 +02:00
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
2022-11-18 21:36:55 +01:00
msg := fmt . Sprintf ( "unexpected success response for share: API contract not enforced by server. Client expected to get an error, but got: %T" , result )
2022-07-26 21:38:35 +02:00
panic ( msg )
}
2022-11-23 18:12:11 +01:00
/ *
Unaccess unaccess API
* /
func ( a * Client ) Unaccess ( params * UnaccessParams , authInfo runtime . ClientAuthInfoWriter , opts ... ClientOption ) ( * UnaccessOK , error ) {
// TODO: Validate the params before sending
if params == nil {
params = NewUnaccessParams ( )
}
op := & runtime . ClientOperation {
ID : "unaccess" ,
Method : "DELETE" ,
PathPattern : "/unaccess" ,
ProducesMediaTypes : [ ] string { "application/zrok.v1+json" } ,
ConsumesMediaTypes : [ ] string { "application/zrok.v1+json" } ,
Schemes : [ ] string { "http" } ,
Params : params ,
Reader : & UnaccessReader { 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 . ( * UnaccessOK )
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 unaccess: API contract not enforced by server. Client expected to get an error, but got: %T" , result )
panic ( msg )
}
2022-07-27 17:35:28 +02:00
/ *
2022-11-18 21:36:55 +01:00
Unshare unshare API
2022-07-27 17:35:28 +02:00
* /
2022-11-18 21:36:55 +01:00
func ( a * Client ) Unshare ( params * UnshareParams , authInfo runtime . ClientAuthInfoWriter , opts ... ClientOption ) ( * UnshareOK , error ) {
2022-07-27 17:35:28 +02:00
// TODO: Validate the params before sending
if params == nil {
2022-11-18 21:36:55 +01:00
params = NewUnshareParams ( )
2022-07-27 17:35:28 +02:00
}
op := & runtime . ClientOperation {
2022-11-18 21:36:55 +01:00
ID : "unshare" ,
2022-07-27 17:35:28 +02:00
Method : "DELETE" ,
2022-11-18 21:36:55 +01:00
PathPattern : "/unshare" ,
2022-07-27 17:35:28 +02:00
ProducesMediaTypes : [ ] string { "application/zrok.v1+json" } ,
ConsumesMediaTypes : [ ] string { "application/zrok.v1+json" } ,
Schemes : [ ] string { "http" } ,
Params : params ,
2022-11-18 21:36:55 +01:00
Reader : & UnshareReader { formats : a . formats } ,
2022-07-28 20:32:49 +02:00
AuthInfo : authInfo ,
2022-07-27 17:35:28 +02:00
Context : params . Context ,
Client : params . HTTPClient ,
}
for _ , opt := range opts {
opt ( op )
}
result , err := a . transport . Submit ( op )
if err != nil {
return nil , err
}
2022-11-18 21:36:55 +01:00
success , ok := result . ( * UnshareOK )
2022-07-27 17:35:28 +02:00
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
2022-11-18 21:36:55 +01:00
msg := fmt . Sprintf ( "unexpected success response for unshare: API contract not enforced by server. Client expected to get an error, but got: %T" , result )
2022-07-27 17:35:28 +02:00
panic ( msg )
}
2022-12-02 19:21:05 +01:00
/ *
UpdateShare update share API
* /
func ( a * Client ) UpdateShare ( params * UpdateShareParams , authInfo runtime . ClientAuthInfoWriter , opts ... ClientOption ) ( * UpdateShareOK , error ) {
// TODO: Validate the params before sending
if params == nil {
params = NewUpdateShareParams ( )
}
op := & runtime . ClientOperation {
ID : "updateShare" ,
Method : "PATCH" ,
PathPattern : "/share" ,
ProducesMediaTypes : [ ] string { "application/zrok.v1+json" } ,
ConsumesMediaTypes : [ ] string { "application/zrok.v1+json" } ,
Schemes : [ ] string { "http" } ,
Params : params ,
Reader : & UpdateShareReader { 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 . ( * UpdateShareOK )
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 updateShare: API contract not enforced by server. Client expected to get an error, but got: %T" , result )
panic ( msg )
}
2022-07-26 21:38:35 +02:00
// SetTransport changes the transport on the client
func ( a * Client ) SetTransport ( transport runtime . ClientTransport ) {
a . transport = transport
}