代码拉取完成,页面将自动刷新
// Code generated by go-swagger; DO NOT EDIT.
package ldap
// 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 ldap API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for ldap API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientService is the interface for Client methods
type ClientService interface {
ImportLdapUser(params *ImportLdapUserParams, authInfo runtime.ClientAuthInfoWriter) (*ImportLdapUserOK, error)
PingLdap(params *PingLdapParams, authInfo runtime.ClientAuthInfoWriter) (*PingLdapOK, error)
SearchLdapGroup(params *SearchLdapGroupParams, authInfo runtime.ClientAuthInfoWriter) (*SearchLdapGroupOK, error)
SearchLdapUser(params *SearchLdapUserParams, authInfo runtime.ClientAuthInfoWriter) (*SearchLdapUserOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
ImportLdapUser imports selected available ldap users
This endpoint adds the selected available ldap users to harbor based on related configuration parameters from the system. System will try to guess the user email address and realname, add to harbor user information. If have errors when import user, will return the list of importing failed uid and the failed reason.
*/
func (a *Client) ImportLdapUser(params *ImportLdapUserParams, authInfo runtime.ClientAuthInfoWriter) (*ImportLdapUserOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewImportLdapUserParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "importLdapUser",
Method: "POST",
PathPattern: "/ldap/users/import",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &ImportLdapUserReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
success, ok := result.(*ImportLdapUserOK)
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 importLdapUser: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PingLdap pings available ldap service
This endpoint ping the available ldap service for test related configuration parameters.
*/
func (a *Client) PingLdap(params *PingLdapParams, authInfo runtime.ClientAuthInfoWriter) (*PingLdapOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPingLdapParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "pingLdap",
Method: "POST",
PathPattern: "/ldap/ping",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &PingLdapReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
success, ok := result.(*PingLdapOK)
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 pingLdap: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
SearchLdapGroup searches available ldap groups
This endpoint searches the available ldap groups based on related configuration parameters. support to search by groupname or groupdn.
*/
func (a *Client) SearchLdapGroup(params *SearchLdapGroupParams, authInfo runtime.ClientAuthInfoWriter) (*SearchLdapGroupOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewSearchLdapGroupParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "searchLdapGroup",
Method: "GET",
PathPattern: "/ldap/groups/search",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &SearchLdapGroupReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
success, ok := result.(*SearchLdapGroupOK)
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 searchLdapGroup: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
SearchLdapUser searches available ldap users
This endpoint searches the available ldap users based on related configuration parameters. Support searched by input ladp configuration, load configuration from the system and specific filter.
*/
func (a *Client) SearchLdapUser(params *SearchLdapUserParams, authInfo runtime.ClientAuthInfoWriter) (*SearchLdapUserOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewSearchLdapUserParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "searchLdapUser",
Method: "GET",
PathPattern: "/ldap/users/search",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &SearchLdapUserReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
success, ok := result.(*SearchLdapUserOK)
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 searchLdapUser: 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
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。