1 // Code generated by go-swagger; DO NOT EDIT.
5 // This file was generated by the swagger tool.
6 // Editing this file might prove futile when you re-run the swagger generate command
11 "github.com/go-openapi/runtime"
12 "github.com/go-openapi/strfmt"
15 // New creates a new common API client.
16 func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
17 return &Client{transport: transport, formats: formats}
24 transport runtime.ClientTransport
25 formats strfmt.Registry
28 // ClientService is the interface for Client methods
29 type ClientService interface {
30 Subscribe(params *SubscribeParams) (*SubscribeCreated, error)
32 Unsubscribe(params *UnsubscribeParams) (*UnsubscribeNoContent, error)
34 GetAllSubscriptions(params *GetAllSubscriptionsParams) (*GetAllSubscriptionsOK, error)
36 SetTransport(transport runtime.ClientTransport)
40 Subscribe subscribes a list of x2 a p event triggers to receive messages sent by r a n
42 func (a *Client) Subscribe(params *SubscribeParams) (*SubscribeCreated, error) {
43 // TODO: Validate the params before sending
45 params = NewSubscribeParams()
48 result, err := a.transport.Submit(&runtime.ClientOperation{
51 PathPattern: "/subscriptions",
52 ProducesMediaTypes: []string{"application/json"},
53 ConsumesMediaTypes: []string{"application/json"},
54 Schemes: []string{"http"},
56 Reader: &SubscribeReader{formats: a.formats},
57 Context: params.Context,
58 Client: params.HTTPClient,
63 success, ok := result.(*SubscribeCreated)
67 // unexpected success response
68 // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
69 msg := fmt.Sprintf("unexpected success response for Subscribe: API contract not enforced by server. Client expected to get an error, but got: %T", result)
74 Unsubscribe unsubscribes x2 a p events from subscription manager
76 func (a *Client) Unsubscribe(params *UnsubscribeParams) (*UnsubscribeNoContent, error) {
77 // TODO: Validate the params before sending
79 params = NewUnsubscribeParams()
82 result, err := a.transport.Submit(&runtime.ClientOperation{
85 PathPattern: "/subscriptions/{subscriptionId}",
86 ProducesMediaTypes: []string{"application/json"},
87 ConsumesMediaTypes: []string{"application/json"},
88 Schemes: []string{"http"},
90 Reader: &UnsubscribeReader{formats: a.formats},
91 Context: params.Context,
92 Client: params.HTTPClient,
97 success, ok := result.(*UnsubscribeNoContent)
101 // unexpected success response
102 // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
103 msg := fmt.Sprintf("unexpected success response for Unsubscribe: API contract not enforced by server. Client expected to get an error, but got: %T", result)
108 GetAllSubscriptions returns list of subscriptions
110 func (a *Client) GetAllSubscriptions(params *GetAllSubscriptionsParams) (*GetAllSubscriptionsOK, error) {
111 // TODO: Validate the params before sending
113 params = NewGetAllSubscriptionsParams()
116 result, err := a.transport.Submit(&runtime.ClientOperation{
117 ID: "getAllSubscriptions",
119 PathPattern: "/subscriptions",
120 ProducesMediaTypes: []string{"application/json"},
121 ConsumesMediaTypes: []string{"application/json"},
122 Schemes: []string{"http"},
124 Reader: &GetAllSubscriptionsReader{formats: a.formats},
125 Context: params.Context,
126 Client: params.HTTPClient,
131 success, ok := result.(*GetAllSubscriptionsOK)
135 // unexpected success response
136 // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
137 msg := fmt.Sprintf("unexpected success response for getAllSubscriptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
141 // SetTransport changes the transport on the client
142 func (a *Client) SetTransport(transport runtime.ClientTransport) {
143 a.transport = transport