github.com/sap/cf-mta-plugin@v2.6.3+incompatible/clients/restclient/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  	"github.com/go-openapi/runtime"
    10  
    11  	strfmt "github.com/go-openapi/strfmt"
    12  )
    13  
    14  // New creates a new operations API client.
    15  func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
    16  	return &Client{transport: transport, formats: formats}
    17  }
    18  
    19  /*
    20  Client for operations API
    21  */
    22  type Client struct {
    23  	transport runtime.ClientTransport
    24  	formats   strfmt.Registry
    25  }
    26  
    27  /*
    28  PurgeConfiguration purge configuration API
    29  */
    30  func (a *Client) PurgeConfiguration(params *PurgeConfigurationParams, authInfo runtime.ClientAuthInfoWriter) (*PurgeConfigurationNoContent, error) {
    31  	// TODO: Validate the params before sending
    32  	if params == nil {
    33  		params = NewPurgeConfigurationParams()
    34  	}
    35  
    36  	result, err := a.transport.Submit(&runtime.ClientOperation{
    37  		ID:                 "PurgeConfiguration",
    38  		Method:             "POST",
    39  		PathPattern:        "/configuration-entries/purge",
    40  		ProducesMediaTypes: []string{"application/xml"},
    41  		ConsumesMediaTypes: []string{"application/xml"},
    42  		Schemes:            []string{"https"},
    43  		Params:             params,
    44  		Reader:             &PurgeConfigurationReader{formats: a.formats},
    45  		AuthInfo:           authInfo,
    46  		Context:            params.Context,
    47  		Client:             params.HTTPClient,
    48  	})
    49  	if err != nil {
    50  		return nil, err
    51  	}
    52  	return result.(*PurgeConfigurationNoContent), nil
    53  
    54  }
    55  
    56  // SetTransport changes the transport on the client
    57  func (a *Client) SetTransport(transport runtime.ClientTransport) {
    58  	a.transport = transport
    59  }
    60  
    61  /*
    62  GetCsrfToken Retrieves a csrf-token header
    63  
    64  */
    65  func (a *Client) GetCsrfToken(params *GetCsrfTokenParams, authInfo runtime.ClientAuthInfoWriter) (*GetCsrfTokenNoContent, error) {
    66  	// TODO: Validate the params before sending
    67  	if params == nil {
    68  		params = NewGetCsrfTokenParams()
    69  	}
    70  
    71  	result, err := a.transport.Submit(&runtime.ClientOperation{
    72  		ID:                 "getCsrfToken",
    73  		Method:             "GET",
    74  		PathPattern:        "/csrf-token",
    75  		ProducesMediaTypes: []string{"application/json"},
    76  		ConsumesMediaTypes: []string{"application/json"},
    77  		Schemes:            []string{"https"},
    78  		Params:             params,
    79  		Reader:             &GetCsrfTokenReader{formats: a.formats},
    80  		AuthInfo:           authInfo,
    81  		Context:            params.Context,
    82  		Client:             params.HTTPClient,
    83  	})
    84  	if err != nil {
    85  		return nil, err
    86  	}
    87  	return result.(*GetCsrfTokenNoContent), nil
    88  
    89  }