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

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package project_metadata
     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 project metadata client
    19  type API interface {
    20  	/*
    21  	   AddProjectMetadatas adds metadata for the specific project
    22  
    23  	   Add metadata for the specific project*/
    24  	AddProjectMetadatas(ctx context.Context, params *AddProjectMetadatasParams) (*AddProjectMetadatasOK, error)
    25  	/*
    26  	   DeleteProjectMetadata deletes the specific metadata for the specific project
    27  
    28  	   Delete the specific metadata for the specific project*/
    29  	DeleteProjectMetadata(ctx context.Context, params *DeleteProjectMetadataParams) (*DeleteProjectMetadataOK, error)
    30  	/*
    31  	   GetProjectMetadata gets the specific metadata of the specific project
    32  
    33  	   Get the specific metadata of the specific project*/
    34  	GetProjectMetadata(ctx context.Context, params *GetProjectMetadataParams) (*GetProjectMetadataOK, error)
    35  	/*
    36  	   ListProjectMetadatas gets the metadata of the specific project
    37  
    38  	   Get the metadata of the specific project*/
    39  	ListProjectMetadatas(ctx context.Context, params *ListProjectMetadatasParams) (*ListProjectMetadatasOK, error)
    40  	/*
    41  	   UpdateProjectMetadata updates the specific metadata for the specific project
    42  
    43  	   Update the specific metadata for the specific project*/
    44  	UpdateProjectMetadata(ctx context.Context, params *UpdateProjectMetadataParams) (*UpdateProjectMetadataOK, error)
    45  }
    46  
    47  // New creates a new project metadata API client.
    48  func New(transport runtime.ClientTransport, formats strfmt.Registry, authInfo runtime.ClientAuthInfoWriter) *Client {
    49  	return &Client{
    50  		transport: transport,
    51  		formats:   formats,
    52  		authInfo:  authInfo,
    53  	}
    54  }
    55  
    56  /*
    57  Client for project metadata API
    58  */
    59  type Client struct {
    60  	transport runtime.ClientTransport
    61  	formats   strfmt.Registry
    62  	authInfo  runtime.ClientAuthInfoWriter
    63  }
    64  
    65  /*
    66  AddProjectMetadatas adds metadata for the specific project
    67  
    68  Add metadata for the specific project
    69  */
    70  func (a *Client) AddProjectMetadatas(ctx context.Context, params *AddProjectMetadatasParams) (*AddProjectMetadatasOK, error) {
    71  
    72  	result, err := a.transport.Submit(&runtime.ClientOperation{
    73  		ID:                 "addProjectMetadatas",
    74  		Method:             "POST",
    75  		PathPattern:        "/projects/{project_name_or_id}/metadatas/",
    76  		ProducesMediaTypes: []string{"application/json"},
    77  		ConsumesMediaTypes: []string{"application/json"},
    78  		Schemes:            []string{"http", "https"},
    79  		Params:             params,
    80  		Reader:             &AddProjectMetadatasReader{formats: a.formats},
    81  		AuthInfo:           a.authInfo,
    82  		Context:            ctx,
    83  		Client:             params.HTTPClient,
    84  	})
    85  	if err != nil {
    86  		return nil, err
    87  	}
    88  	return result.(*AddProjectMetadatasOK), nil
    89  
    90  }
    91  
    92  /*
    93  DeleteProjectMetadata deletes the specific metadata for the specific project
    94  
    95  Delete the specific metadata for the specific project
    96  */
    97  func (a *Client) DeleteProjectMetadata(ctx context.Context, params *DeleteProjectMetadataParams) (*DeleteProjectMetadataOK, error) {
    98  
    99  	result, err := a.transport.Submit(&runtime.ClientOperation{
   100  		ID:                 "deleteProjectMetadata",
   101  		Method:             "DELETE",
   102  		PathPattern:        "/projects/{project_name_or_id}/metadatas/{meta_name}",
   103  		ProducesMediaTypes: []string{"application/json"},
   104  		ConsumesMediaTypes: []string{"application/json"},
   105  		Schemes:            []string{"http", "https"},
   106  		Params:             params,
   107  		Reader:             &DeleteProjectMetadataReader{formats: a.formats},
   108  		AuthInfo:           a.authInfo,
   109  		Context:            ctx,
   110  		Client:             params.HTTPClient,
   111  	})
   112  	if err != nil {
   113  		return nil, err
   114  	}
   115  	return result.(*DeleteProjectMetadataOK), nil
   116  
   117  }
   118  
   119  /*
   120  GetProjectMetadata gets the specific metadata of the specific project
   121  
   122  Get the specific metadata of the specific project
   123  */
   124  func (a *Client) GetProjectMetadata(ctx context.Context, params *GetProjectMetadataParams) (*GetProjectMetadataOK, error) {
   125  
   126  	result, err := a.transport.Submit(&runtime.ClientOperation{
   127  		ID:                 "getProjectMetadata",
   128  		Method:             "GET",
   129  		PathPattern:        "/projects/{project_name_or_id}/metadatas/{meta_name}",
   130  		ProducesMediaTypes: []string{"application/json"},
   131  		ConsumesMediaTypes: []string{"application/json"},
   132  		Schemes:            []string{"http", "https"},
   133  		Params:             params,
   134  		Reader:             &GetProjectMetadataReader{formats: a.formats},
   135  		AuthInfo:           a.authInfo,
   136  		Context:            ctx,
   137  		Client:             params.HTTPClient,
   138  	})
   139  	if err != nil {
   140  		return nil, err
   141  	}
   142  	return result.(*GetProjectMetadataOK), nil
   143  
   144  }
   145  
   146  /*
   147  ListProjectMetadatas gets the metadata of the specific project
   148  
   149  Get the metadata of the specific project
   150  */
   151  func (a *Client) ListProjectMetadatas(ctx context.Context, params *ListProjectMetadatasParams) (*ListProjectMetadatasOK, error) {
   152  
   153  	result, err := a.transport.Submit(&runtime.ClientOperation{
   154  		ID:                 "listProjectMetadatas",
   155  		Method:             "GET",
   156  		PathPattern:        "/projects/{project_name_or_id}/metadatas/",
   157  		ProducesMediaTypes: []string{"application/json"},
   158  		ConsumesMediaTypes: []string{"application/json"},
   159  		Schemes:            []string{"http", "https"},
   160  		Params:             params,
   161  		Reader:             &ListProjectMetadatasReader{formats: a.formats},
   162  		AuthInfo:           a.authInfo,
   163  		Context:            ctx,
   164  		Client:             params.HTTPClient,
   165  	})
   166  	if err != nil {
   167  		return nil, err
   168  	}
   169  	return result.(*ListProjectMetadatasOK), nil
   170  
   171  }
   172  
   173  /*
   174  UpdateProjectMetadata updates the specific metadata for the specific project
   175  
   176  Update the specific metadata for the specific project
   177  */
   178  func (a *Client) UpdateProjectMetadata(ctx context.Context, params *UpdateProjectMetadataParams) (*UpdateProjectMetadataOK, error) {
   179  
   180  	result, err := a.transport.Submit(&runtime.ClientOperation{
   181  		ID:                 "updateProjectMetadata",
   182  		Method:             "PUT",
   183  		PathPattern:        "/projects/{project_name_or_id}/metadatas/{meta_name}",
   184  		ProducesMediaTypes: []string{"application/json"},
   185  		ConsumesMediaTypes: []string{"application/json"},
   186  		Schemes:            []string{"http", "https"},
   187  		Params:             params,
   188  		Reader:             &UpdateProjectMetadataReader{formats: a.formats},
   189  		AuthInfo:           a.authInfo,
   190  		Context:            ctx,
   191  		Client:             params.HTTPClient,
   192  	})
   193  	if err != nil {
   194  		return nil, err
   195  	}
   196  	return result.(*UpdateProjectMetadataOK), nil
   197  
   198  }