1 Star 0 Fork 0

nanjo_fan / goharbor-client

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
project_metadata_client.go 8.48 KB
一键复制 编辑 原始数据 按行查看 历史
王帆 提交于 2023-02-13 08:49 . first commit
// Code generated by go-swagger; DO NOT EDIT.
package project_metadata
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// New creates a new project metadata API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for project metadata API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientService is the interface for Client methods
type ClientService interface {
AddProjectMetadatas(params *AddProjectMetadatasParams, authInfo runtime.ClientAuthInfoWriter) (*AddProjectMetadatasOK, error)
DeleteProjectMetadata(params *DeleteProjectMetadataParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteProjectMetadataOK, error)
GetProjectMetadata(params *GetProjectMetadataParams, authInfo runtime.ClientAuthInfoWriter) (*GetProjectMetadataOK, error)
ListProjectMetadatas(params *ListProjectMetadatasParams, authInfo runtime.ClientAuthInfoWriter) (*ListProjectMetadatasOK, error)
UpdateProjectMetadata(params *UpdateProjectMetadataParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateProjectMetadataOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
AddProjectMetadatas adds metadata for the specific project
Add metadata for the specific project
*/
func (a *Client) AddProjectMetadatas(params *AddProjectMetadatasParams, authInfo runtime.ClientAuthInfoWriter) (*AddProjectMetadatasOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewAddProjectMetadatasParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "addProjectMetadatas",
Method: "POST",
PathPattern: "/projects/{project_name_or_id}/metadatas/",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &AddProjectMetadatasReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
success, ok := result.(*AddProjectMetadatasOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for addProjectMetadatas: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
DeleteProjectMetadata deletes the specific metadata for the specific project
Delete the specific metadata for the specific project
*/
func (a *Client) DeleteProjectMetadata(params *DeleteProjectMetadataParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteProjectMetadataOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewDeleteProjectMetadataParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "deleteProjectMetadata",
Method: "DELETE",
PathPattern: "/projects/{project_name_or_id}/metadatas/{meta_name}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &DeleteProjectMetadataReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
success, ok := result.(*DeleteProjectMetadataOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for deleteProjectMetadata: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetProjectMetadata gets the specific metadata of the specific project
Get the specific metadata of the specific project
*/
func (a *Client) GetProjectMetadata(params *GetProjectMetadataParams, authInfo runtime.ClientAuthInfoWriter) (*GetProjectMetadataOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetProjectMetadataParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "getProjectMetadata",
Method: "GET",
PathPattern: "/projects/{project_name_or_id}/metadatas/{meta_name}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &GetProjectMetadataReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
success, ok := result.(*GetProjectMetadataOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getProjectMetadata: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
ListProjectMetadatas gets the metadata of the specific project
Get the metadata of the specific project
*/
func (a *Client) ListProjectMetadatas(params *ListProjectMetadatasParams, authInfo runtime.ClientAuthInfoWriter) (*ListProjectMetadatasOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewListProjectMetadatasParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "listProjectMetadatas",
Method: "GET",
PathPattern: "/projects/{project_name_or_id}/metadatas/",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &ListProjectMetadatasReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
success, ok := result.(*ListProjectMetadatasOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for listProjectMetadatas: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
UpdateProjectMetadata updates the specific metadata for the specific project
Update the specific metadata for the specific project
*/
func (a *Client) UpdateProjectMetadata(params *UpdateProjectMetadataParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateProjectMetadataOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewUpdateProjectMetadataParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "updateProjectMetadata",
Method: "PUT",
PathPattern: "/projects/{project_name_or_id}/metadatas/{meta_name}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &UpdateProjectMetadataReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
success, ok := result.(*UpdateProjectMetadataOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for updateProjectMetadata: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
a.transport = transport
}
Go
1
https://gitee.com/nanjo-fan/goharbor-client.git
git@gitee.com:nanjo-fan/goharbor-client.git
nanjo-fan
goharbor-client
goharbor-client
v1.0.2

搜索帮助