// Code generated by go-swagger; DO NOT EDIT. package share // 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 share API client. func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } /* Client for share 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 { Access(params *AccessParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AccessCreated, error) Share(params *ShareParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ShareCreated, error) Unaccess(params *UnaccessParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UnaccessOK, error) Unshare(params *UnshareParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UnshareOK, error) UpdateShare(params *UpdateShareParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateShareOK, error) SetTransport(transport runtime.ClientTransport) } /* 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) } /* Share share API */ func (a *Client) Share(params *ShareParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ShareCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewShareParams() } op := &runtime.ClientOperation{ ID: "share", Method: "POST", PathPattern: "/share", ProducesMediaTypes: []string{"application/zrok.v1+json"}, ConsumesMediaTypes: []string{"application/zrok.v1+json"}, Schemes: []string{"http"}, Params: params, Reader: &ShareReader{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.(*ShareCreated) 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 share: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* 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) } /* Unshare unshare API */ func (a *Client) Unshare(params *UnshareParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UnshareOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUnshareParams() } op := &runtime.ClientOperation{ ID: "unshare", Method: "DELETE", PathPattern: "/unshare", ProducesMediaTypes: []string{"application/zrok.v1+json"}, ConsumesMediaTypes: []string{"application/zrok.v1+json"}, Schemes: []string{"http"}, Params: params, Reader: &UnshareReader{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.(*UnshareOK) 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 unshare: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* 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) } // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport }