代码拉取完成,页面将自动刷新
// 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
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。