github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/registry/registry_client.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package registry
     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  	"context"
    10  
    11  	"github.com/go-openapi/runtime"
    12  
    13  	strfmt "github.com/go-openapi/strfmt"
    14  )
    15  
    16  //go:generate mockery -name API -inpkg
    17  
    18  // API is the interface of the registry client
    19  type API interface {
    20  	/*
    21  	   CreateRegistry creates a registry
    22  
    23  	   Create a registry*/
    24  	CreateRegistry(ctx context.Context, params *CreateRegistryParams) (*CreateRegistryCreated, error)
    25  	/*
    26  	   DeleteRegistry deletes the specific registry
    27  
    28  	   Delete the specific registry*/
    29  	DeleteRegistry(ctx context.Context, params *DeleteRegistryParams) (*DeleteRegistryOK, error)
    30  	/*
    31  	   GetRegistry gets the specific registry
    32  
    33  	   Get the specific registry*/
    34  	GetRegistry(ctx context.Context, params *GetRegistryParams) (*GetRegistryOK, error)
    35  	/*
    36  	   GetRegistryInfo gets the registry info
    37  
    38  	   Get the registry info*/
    39  	GetRegistryInfo(ctx context.Context, params *GetRegistryInfoParams) (*GetRegistryInfoOK, error)
    40  	/*
    41  	   ListRegistries lists the registries
    42  
    43  	   List the registries*/
    44  	ListRegistries(ctx context.Context, params *ListRegistriesParams) (*ListRegistriesOK, error)
    45  	/*
    46  	   ListRegistryProviderInfos lists all registered registry provider information
    47  
    48  	   List all registered registry provider information*/
    49  	ListRegistryProviderInfos(ctx context.Context, params *ListRegistryProviderInfosParams) (*ListRegistryProviderInfosOK, error)
    50  	/*
    51  	   ListRegistryProviderTypes lists registry adapters
    52  
    53  	   List registry adapters*/
    54  	ListRegistryProviderTypes(ctx context.Context, params *ListRegistryProviderTypesParams) (*ListRegistryProviderTypesOK, error)
    55  	/*
    56  	   PingRegistry checks status of a registry
    57  
    58  	   Check status of a registry*/
    59  	PingRegistry(ctx context.Context, params *PingRegistryParams) (*PingRegistryOK, error)
    60  	/*
    61  	   UpdateRegistry updates the registry
    62  
    63  	   Update the registry*/
    64  	UpdateRegistry(ctx context.Context, params *UpdateRegistryParams) (*UpdateRegistryOK, error)
    65  }
    66  
    67  // New creates a new registry API client.
    68  func New(transport runtime.ClientTransport, formats strfmt.Registry, authInfo runtime.ClientAuthInfoWriter) *Client {
    69  	return &Client{
    70  		transport: transport,
    71  		formats:   formats,
    72  		authInfo:  authInfo,
    73  	}
    74  }
    75  
    76  /*
    77  Client for registry API
    78  */
    79  type Client struct {
    80  	transport runtime.ClientTransport
    81  	formats   strfmt.Registry
    82  	authInfo  runtime.ClientAuthInfoWriter
    83  }
    84  
    85  /*
    86  CreateRegistry creates a registry
    87  
    88  Create a registry
    89  */
    90  func (a *Client) CreateRegistry(ctx context.Context, params *CreateRegistryParams) (*CreateRegistryCreated, error) {
    91  
    92  	result, err := a.transport.Submit(&runtime.ClientOperation{
    93  		ID:                 "createRegistry",
    94  		Method:             "POST",
    95  		PathPattern:        "/registries",
    96  		ProducesMediaTypes: []string{"application/json"},
    97  		ConsumesMediaTypes: []string{"application/json"},
    98  		Schemes:            []string{"http", "https"},
    99  		Params:             params,
   100  		Reader:             &CreateRegistryReader{formats: a.formats},
   101  		AuthInfo:           a.authInfo,
   102  		Context:            ctx,
   103  		Client:             params.HTTPClient,
   104  	})
   105  	if err != nil {
   106  		return nil, err
   107  	}
   108  	return result.(*CreateRegistryCreated), nil
   109  
   110  }
   111  
   112  /*
   113  DeleteRegistry deletes the specific registry
   114  
   115  Delete the specific registry
   116  */
   117  func (a *Client) DeleteRegistry(ctx context.Context, params *DeleteRegistryParams) (*DeleteRegistryOK, error) {
   118  
   119  	result, err := a.transport.Submit(&runtime.ClientOperation{
   120  		ID:                 "deleteRegistry",
   121  		Method:             "DELETE",
   122  		PathPattern:        "/registries/{id}",
   123  		ProducesMediaTypes: []string{"application/json"},
   124  		ConsumesMediaTypes: []string{"application/json"},
   125  		Schemes:            []string{"http", "https"},
   126  		Params:             params,
   127  		Reader:             &DeleteRegistryReader{formats: a.formats},
   128  		AuthInfo:           a.authInfo,
   129  		Context:            ctx,
   130  		Client:             params.HTTPClient,
   131  	})
   132  	if err != nil {
   133  		return nil, err
   134  	}
   135  	return result.(*DeleteRegistryOK), nil
   136  
   137  }
   138  
   139  /*
   140  GetRegistry gets the specific registry
   141  
   142  Get the specific registry
   143  */
   144  func (a *Client) GetRegistry(ctx context.Context, params *GetRegistryParams) (*GetRegistryOK, error) {
   145  
   146  	result, err := a.transport.Submit(&runtime.ClientOperation{
   147  		ID:                 "getRegistry",
   148  		Method:             "GET",
   149  		PathPattern:        "/registries/{id}",
   150  		ProducesMediaTypes: []string{"application/json"},
   151  		ConsumesMediaTypes: []string{"application/json"},
   152  		Schemes:            []string{"http", "https"},
   153  		Params:             params,
   154  		Reader:             &GetRegistryReader{formats: a.formats},
   155  		AuthInfo:           a.authInfo,
   156  		Context:            ctx,
   157  		Client:             params.HTTPClient,
   158  	})
   159  	if err != nil {
   160  		return nil, err
   161  	}
   162  	return result.(*GetRegistryOK), nil
   163  
   164  }
   165  
   166  /*
   167  GetRegistryInfo gets the registry info
   168  
   169  Get the registry info
   170  */
   171  func (a *Client) GetRegistryInfo(ctx context.Context, params *GetRegistryInfoParams) (*GetRegistryInfoOK, error) {
   172  
   173  	result, err := a.transport.Submit(&runtime.ClientOperation{
   174  		ID:                 "getRegistryInfo",
   175  		Method:             "GET",
   176  		PathPattern:        "/registries/{id}/info",
   177  		ProducesMediaTypes: []string{"application/json"},
   178  		ConsumesMediaTypes: []string{"application/json"},
   179  		Schemes:            []string{"http", "https"},
   180  		Params:             params,
   181  		Reader:             &GetRegistryInfoReader{formats: a.formats},
   182  		AuthInfo:           a.authInfo,
   183  		Context:            ctx,
   184  		Client:             params.HTTPClient,
   185  	})
   186  	if err != nil {
   187  		return nil, err
   188  	}
   189  	return result.(*GetRegistryInfoOK), nil
   190  
   191  }
   192  
   193  /*
   194  ListRegistries lists the registries
   195  
   196  List the registries
   197  */
   198  func (a *Client) ListRegistries(ctx context.Context, params *ListRegistriesParams) (*ListRegistriesOK, error) {
   199  
   200  	result, err := a.transport.Submit(&runtime.ClientOperation{
   201  		ID:                 "listRegistries",
   202  		Method:             "GET",
   203  		PathPattern:        "/registries",
   204  		ProducesMediaTypes: []string{"application/json"},
   205  		ConsumesMediaTypes: []string{"application/json"},
   206  		Schemes:            []string{"http", "https"},
   207  		Params:             params,
   208  		Reader:             &ListRegistriesReader{formats: a.formats},
   209  		AuthInfo:           a.authInfo,
   210  		Context:            ctx,
   211  		Client:             params.HTTPClient,
   212  	})
   213  	if err != nil {
   214  		return nil, err
   215  	}
   216  	return result.(*ListRegistriesOK), nil
   217  
   218  }
   219  
   220  /*
   221  ListRegistryProviderInfos lists all registered registry provider information
   222  
   223  List all registered registry provider information
   224  */
   225  func (a *Client) ListRegistryProviderInfos(ctx context.Context, params *ListRegistryProviderInfosParams) (*ListRegistryProviderInfosOK, error) {
   226  
   227  	result, err := a.transport.Submit(&runtime.ClientOperation{
   228  		ID:                 "listRegistryProviderInfos",
   229  		Method:             "GET",
   230  		PathPattern:        "/replication/adapterinfos",
   231  		ProducesMediaTypes: []string{"application/json"},
   232  		ConsumesMediaTypes: []string{"application/json"},
   233  		Schemes:            []string{"http", "https"},
   234  		Params:             params,
   235  		Reader:             &ListRegistryProviderInfosReader{formats: a.formats},
   236  		AuthInfo:           a.authInfo,
   237  		Context:            ctx,
   238  		Client:             params.HTTPClient,
   239  	})
   240  	if err != nil {
   241  		return nil, err
   242  	}
   243  	return result.(*ListRegistryProviderInfosOK), nil
   244  
   245  }
   246  
   247  /*
   248  ListRegistryProviderTypes lists registry adapters
   249  
   250  List registry adapters
   251  */
   252  func (a *Client) ListRegistryProviderTypes(ctx context.Context, params *ListRegistryProviderTypesParams) (*ListRegistryProviderTypesOK, error) {
   253  
   254  	result, err := a.transport.Submit(&runtime.ClientOperation{
   255  		ID:                 "listRegistryProviderTypes",
   256  		Method:             "GET",
   257  		PathPattern:        "/replication/adapters",
   258  		ProducesMediaTypes: []string{"application/json"},
   259  		ConsumesMediaTypes: []string{"application/json"},
   260  		Schemes:            []string{"http", "https"},
   261  		Params:             params,
   262  		Reader:             &ListRegistryProviderTypesReader{formats: a.formats},
   263  		AuthInfo:           a.authInfo,
   264  		Context:            ctx,
   265  		Client:             params.HTTPClient,
   266  	})
   267  	if err != nil {
   268  		return nil, err
   269  	}
   270  	return result.(*ListRegistryProviderTypesOK), nil
   271  
   272  }
   273  
   274  /*
   275  PingRegistry checks status of a registry
   276  
   277  Check status of a registry
   278  */
   279  func (a *Client) PingRegistry(ctx context.Context, params *PingRegistryParams) (*PingRegistryOK, error) {
   280  
   281  	result, err := a.transport.Submit(&runtime.ClientOperation{
   282  		ID:                 "pingRegistry",
   283  		Method:             "POST",
   284  		PathPattern:        "/registries/ping",
   285  		ProducesMediaTypes: []string{"application/json"},
   286  		ConsumesMediaTypes: []string{"application/json"},
   287  		Schemes:            []string{"http", "https"},
   288  		Params:             params,
   289  		Reader:             &PingRegistryReader{formats: a.formats},
   290  		AuthInfo:           a.authInfo,
   291  		Context:            ctx,
   292  		Client:             params.HTTPClient,
   293  	})
   294  	if err != nil {
   295  		return nil, err
   296  	}
   297  	return result.(*PingRegistryOK), nil
   298  
   299  }
   300  
   301  /*
   302  UpdateRegistry updates the registry
   303  
   304  Update the registry
   305  */
   306  func (a *Client) UpdateRegistry(ctx context.Context, params *UpdateRegistryParams) (*UpdateRegistryOK, error) {
   307  
   308  	result, err := a.transport.Submit(&runtime.ClientOperation{
   309  		ID:                 "updateRegistry",
   310  		Method:             "PUT",
   311  		PathPattern:        "/registries/{id}",
   312  		ProducesMediaTypes: []string{"application/json"},
   313  		ConsumesMediaTypes: []string{"application/json"},
   314  		Schemes:            []string{"http", "https"},
   315  		Params:             params,
   316  		Reader:             &UpdateRegistryReader{formats: a.formats},
   317  		AuthInfo:           a.authInfo,
   318  		Context:            ctx,
   319  		Client:             params.HTTPClient,
   320  	})
   321  	if err != nil {
   322  		return nil, err
   323  	}
   324  	return result.(*UpdateRegistryOK), nil
   325  
   326  }