github.com/sap/cf-mta-plugin@v2.6.3+incompatible/clients/mtaclient_v2/operations/operations_client.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package operations
     4  
     5  // This file was generated by the swagger tool.
     6  // Editing this file might prove futile when you re-run the swagger generate command
     7  
     8  import (
     9  	"fmt"
    10  
    11  	"github.com/go-openapi/runtime"
    12  
    13  	strfmt "github.com/go-openapi/strfmt"
    14  )
    15  
    16  // New creates a new operations API client.
    17  func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
    18  	return &Client{transport: transport, formats: formats}
    19  }
    20  
    21  /*
    22  Client for operations API
    23  */
    24  type Client struct {
    25  	transport runtime.ClientTransport
    26  	formats   strfmt.Registry
    27  }
    28  
    29  /*
    30  GetMtasV2 Retrieves all Multi-Target Applications in a space
    31  */
    32  func (a *Client) GetMtasV2(params *GetMtasV2Params, authInfo runtime.ClientAuthInfoWriter) (*GetMtasV2OK, error) {
    33  	// TODO: Validate the params before sending
    34  	if params == nil {
    35  		params = NewGetMtasV2Params()
    36  	}
    37  
    38  	result, err := a.transport.Submit(&runtime.ClientOperation{
    39  		ID:                 "getMtasV2",
    40  		Method:             "GET",
    41  		PathPattern:        "/api/v2/spaces/{spaceGuid}/mtas",
    42  		ProducesMediaTypes: []string{"application/json", "application/json;charset=UTF-8"},
    43  		ConsumesMediaTypes: []string{""},
    44  		Schemes:            []string{"https"},
    45  		Params:             params,
    46  		Reader:             &GetMtasV2Reader{formats: a.formats},
    47  		AuthInfo:           authInfo,
    48  		Context:            params.Context,
    49  		Client:             params.HTTPClient,
    50  	})
    51  	if err != nil {
    52  		return nil, err
    53  	}
    54  	success, ok := result.(*GetMtasV2OK)
    55  	if ok {
    56  		return success, nil
    57  	}
    58  	// unexpected success response
    59  	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
    60  	msg := fmt.Sprintf("unexpected success response for getMtasV2: API contract not enforced by server. Client expected to get an error, but got: %T", result)
    61  	panic(msg)
    62  }
    63  
    64  // SetTransport changes the transport on the client
    65  func (a *Client) SetTransport(transport runtime.ClientTransport) {
    66  	a.transport = transport
    67  }