| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
|
|
| package batch |
|
|
| |
| |
|
|
| import ( |
| "fmt" |
|
|
| "github.com/go-openapi/runtime" |
| "github.com/go-openapi/strfmt" |
| ) |
|
|
| |
| func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { |
| return &Client{transport: transport, formats: formats} |
| } |
|
|
| |
| |
| |
| type Client struct { |
| transport runtime.ClientTransport |
| formats strfmt.Registry |
| } |
|
|
| |
| type ClientOption func(*runtime.ClientOperation) |
|
|
| |
| type ClientService interface { |
| BatchObjectsCreate(params *BatchObjectsCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BatchObjectsCreateOK, error) |
|
|
| BatchObjectsDelete(params *BatchObjectsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BatchObjectsDeleteOK, error) |
|
|
| BatchReferencesCreate(params *BatchReferencesCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BatchReferencesCreateOK, error) |
|
|
| SetTransport(transport runtime.ClientTransport) |
| } |
|
|
| |
| |
| |
| |
| |
| func (a *Client) BatchObjectsCreate(params *BatchObjectsCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BatchObjectsCreateOK, error) { |
| |
| if params == nil { |
| params = NewBatchObjectsCreateParams() |
| } |
| op := &runtime.ClientOperation{ |
| ID: "batch.objects.create", |
| Method: "POST", |
| PathPattern: "/batch/objects", |
| ProducesMediaTypes: []string{"application/json"}, |
| ConsumesMediaTypes: []string{"application/json", "application/yaml"}, |
| Schemes: []string{"https"}, |
| Params: params, |
| Reader: &BatchObjectsCreateReader{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.(*BatchObjectsCreateOK) |
| if ok { |
| return success, nil |
| } |
| |
| |
| msg := fmt.Sprintf("unexpected success response for batch.objects.create: API contract not enforced by server. Client expected to get an error, but got: %T", result) |
| panic(msg) |
| } |
|
|
| |
| |
| |
| |
| |
| func (a *Client) BatchObjectsDelete(params *BatchObjectsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BatchObjectsDeleteOK, error) { |
| |
| if params == nil { |
| params = NewBatchObjectsDeleteParams() |
| } |
| op := &runtime.ClientOperation{ |
| ID: "batch.objects.delete", |
| Method: "DELETE", |
| PathPattern: "/batch/objects", |
| ProducesMediaTypes: []string{"application/json"}, |
| ConsumesMediaTypes: []string{"application/json", "application/yaml"}, |
| Schemes: []string{"https"}, |
| Params: params, |
| Reader: &BatchObjectsDeleteReader{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.(*BatchObjectsDeleteOK) |
| if ok { |
| return success, nil |
| } |
| |
| |
| msg := fmt.Sprintf("unexpected success response for batch.objects.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) |
| panic(msg) |
| } |
|
|
| |
| |
| |
| |
| |
| func (a *Client) BatchReferencesCreate(params *BatchReferencesCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BatchReferencesCreateOK, error) { |
| |
| if params == nil { |
| params = NewBatchReferencesCreateParams() |
| } |
| op := &runtime.ClientOperation{ |
| ID: "batch.references.create", |
| Method: "POST", |
| PathPattern: "/batch/references", |
| ProducesMediaTypes: []string{"application/json"}, |
| ConsumesMediaTypes: []string{"application/json", "application/yaml"}, |
| Schemes: []string{"https"}, |
| Params: params, |
| Reader: &BatchReferencesCreateReader{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.(*BatchReferencesCreateOK) |
| if ok { |
| return success, nil |
| } |
| |
| |
| msg := fmt.Sprintf("unexpected success response for batch.references.create: API contract not enforced by server. Client expected to get an error, but got: %T", result) |
| panic(msg) |
| } |
|
|
| |
| func (a *Client) SetTransport(transport runtime.ClientTransport) { |
| a.transport = transport |
| } |
|
|