| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
|
|
| package replication |
|
|
| |
| |
|
|
| 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 { |
| CancelReplication(params *CancelReplicationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CancelReplicationNoContent, error) |
|
|
| DeleteAllReplications(params *DeleteAllReplicationsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAllReplicationsNoContent, error) |
|
|
| DeleteReplication(params *DeleteReplicationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteReplicationNoContent, error) |
|
|
| ForceDeleteReplications(params *ForceDeleteReplicationsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ForceDeleteReplicationsOK, error) |
|
|
| GetCollectionShardingState(params *GetCollectionShardingStateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCollectionShardingStateOK, error) |
|
|
| ListReplication(params *ListReplicationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListReplicationOK, error) |
|
|
| Replicate(params *ReplicateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReplicateOK, error) |
|
|
| ReplicationDetails(params *ReplicationDetailsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReplicationDetailsOK, error) |
|
|
| SetTransport(transport runtime.ClientTransport) |
| } |
|
|
| |
| |
| |
| |
| |
| func (a *Client) CancelReplication(params *CancelReplicationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CancelReplicationNoContent, error) { |
| |
| if params == nil { |
| params = NewCancelReplicationParams() |
| } |
| op := &runtime.ClientOperation{ |
| ID: "cancelReplication", |
| Method: "POST", |
| PathPattern: "/replication/replicate/{id}/cancel", |
| ProducesMediaTypes: []string{"application/json"}, |
| ConsumesMediaTypes: []string{"application/json", "application/yaml"}, |
| Schemes: []string{"https"}, |
| Params: params, |
| Reader: &CancelReplicationReader{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.(*CancelReplicationNoContent) |
| if ok { |
| return success, nil |
| } |
| |
| |
| msg := fmt.Sprintf("unexpected success response for cancelReplication: API contract not enforced by server. Client expected to get an error, but got: %T", result) |
| panic(msg) |
| } |
|
|
| |
| |
| |
| func (a *Client) DeleteAllReplications(params *DeleteAllReplicationsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAllReplicationsNoContent, error) { |
| |
| if params == nil { |
| params = NewDeleteAllReplicationsParams() |
| } |
| op := &runtime.ClientOperation{ |
| ID: "deleteAllReplications", |
| Method: "DELETE", |
| PathPattern: "/replication/replicate", |
| ProducesMediaTypes: []string{"application/json"}, |
| ConsumesMediaTypes: []string{"application/json", "application/yaml"}, |
| Schemes: []string{"https"}, |
| Params: params, |
| Reader: &DeleteAllReplicationsReader{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.(*DeleteAllReplicationsNoContent) |
| if ok { |
| return success, nil |
| } |
| |
| |
| msg := fmt.Sprintf("unexpected success response for deleteAllReplications: API contract not enforced by server. Client expected to get an error, but got: %T", result) |
| panic(msg) |
| } |
|
|
| |
| |
| |
| |
| |
| func (a *Client) DeleteReplication(params *DeleteReplicationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteReplicationNoContent, error) { |
| |
| if params == nil { |
| params = NewDeleteReplicationParams() |
| } |
| op := &runtime.ClientOperation{ |
| ID: "deleteReplication", |
| Method: "DELETE", |
| PathPattern: "/replication/replicate/{id}", |
| ProducesMediaTypes: []string{"application/json"}, |
| ConsumesMediaTypes: []string{"application/json", "application/yaml"}, |
| Schemes: []string{"https"}, |
| Params: params, |
| Reader: &DeleteReplicationReader{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.(*DeleteReplicationNoContent) |
| if ok { |
| return success, nil |
| } |
| |
| |
| msg := fmt.Sprintf("unexpected success response for deleteReplication: API contract not enforced by server. Client expected to get an error, but got: %T", result) |
| panic(msg) |
| } |
|
|
| |
| |
| |
| |
| |
| func (a *Client) ForceDeleteReplications(params *ForceDeleteReplicationsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ForceDeleteReplicationsOK, error) { |
| |
| if params == nil { |
| params = NewForceDeleteReplicationsParams() |
| } |
| op := &runtime.ClientOperation{ |
| ID: "forceDeleteReplications", |
| Method: "POST", |
| PathPattern: "/replication/replicate/force-delete", |
| ProducesMediaTypes: []string{"application/json"}, |
| ConsumesMediaTypes: []string{"application/json", "application/yaml"}, |
| Schemes: []string{"https"}, |
| Params: params, |
| Reader: &ForceDeleteReplicationsReader{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.(*ForceDeleteReplicationsOK) |
| if ok { |
| return success, nil |
| } |
| |
| |
| msg := fmt.Sprintf("unexpected success response for forceDeleteReplications: API contract not enforced by server. Client expected to get an error, but got: %T", result) |
| panic(msg) |
| } |
|
|
| |
| |
| |
| |
| |
| func (a *Client) GetCollectionShardingState(params *GetCollectionShardingStateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCollectionShardingStateOK, error) { |
| |
| if params == nil { |
| params = NewGetCollectionShardingStateParams() |
| } |
| op := &runtime.ClientOperation{ |
| ID: "getCollectionShardingState", |
| Method: "GET", |
| PathPattern: "/replication/sharding-state", |
| ProducesMediaTypes: []string{"application/json"}, |
| ConsumesMediaTypes: []string{"application/json", "application/yaml"}, |
| Schemes: []string{"https"}, |
| Params: params, |
| Reader: &GetCollectionShardingStateReader{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.(*GetCollectionShardingStateOK) |
| if ok { |
| return success, nil |
| } |
| |
| |
| msg := fmt.Sprintf("unexpected success response for getCollectionShardingState: API contract not enforced by server. Client expected to get an error, but got: %T", result) |
| panic(msg) |
| } |
|
|
| |
| |
| |
| |
| |
| func (a *Client) ListReplication(params *ListReplicationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListReplicationOK, error) { |
| |
| if params == nil { |
| params = NewListReplicationParams() |
| } |
| op := &runtime.ClientOperation{ |
| ID: "listReplication", |
| Method: "GET", |
| PathPattern: "/replication/replicate/list", |
| ProducesMediaTypes: []string{"application/json"}, |
| ConsumesMediaTypes: []string{"application/json", "application/yaml"}, |
| Schemes: []string{"https"}, |
| Params: params, |
| Reader: &ListReplicationReader{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.(*ListReplicationOK) |
| if ok { |
| return success, nil |
| } |
| |
| |
| msg := fmt.Sprintf("unexpected success response for listReplication: API contract not enforced by server. Client expected to get an error, but got: %T", result) |
| panic(msg) |
| } |
|
|
| |
| |
| |
| |
| |
| func (a *Client) Replicate(params *ReplicateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReplicateOK, error) { |
| |
| if params == nil { |
| params = NewReplicateParams() |
| } |
| op := &runtime.ClientOperation{ |
| ID: "replicate", |
| Method: "POST", |
| PathPattern: "/replication/replicate", |
| ProducesMediaTypes: []string{"application/json"}, |
| ConsumesMediaTypes: []string{"application/json", "application/yaml"}, |
| Schemes: []string{"https"}, |
| Params: params, |
| Reader: &ReplicateReader{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.(*ReplicateOK) |
| if ok { |
| return success, nil |
| } |
| |
| |
| msg := fmt.Sprintf("unexpected success response for replicate: API contract not enforced by server. Client expected to get an error, but got: %T", result) |
| panic(msg) |
| } |
|
|
| |
| |
| |
| |
| |
| func (a *Client) ReplicationDetails(params *ReplicationDetailsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReplicationDetailsOK, error) { |
| |
| if params == nil { |
| params = NewReplicationDetailsParams() |
| } |
| op := &runtime.ClientOperation{ |
| ID: "replicationDetails", |
| Method: "GET", |
| PathPattern: "/replication/replicate/{id}", |
| ProducesMediaTypes: []string{"application/json"}, |
| ConsumesMediaTypes: []string{"application/json", "application/yaml"}, |
| Schemes: []string{"https"}, |
| Params: params, |
| Reader: &ReplicationDetailsReader{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.(*ReplicationDetailsOK) |
| if ok { |
| return success, nil |
| } |
| |
| |
| msg := fmt.Sprintf("unexpected success response for replicationDetails: 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 |
| } |
|
|