You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
107 lines
3.0 KiB
107 lines
3.0 KiB
3 years ago
|
// Code generated by go-swagger; DO NOT EDIT.
|
||
|
|
||
|
package sync_management
|
||
|
|
||
|
// This file was generated by the swagger tool.
|
||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
"github.com/go-openapi/runtime"
|
||
|
|
||
|
strfmt "github.com/go-openapi/strfmt"
|
||
|
)
|
||
|
|
||
|
//go:generate mockery -name API -inpkg
|
||
|
|
||
|
// API is the interface of the sync management client
|
||
|
type API interface {
|
||
|
/*
|
||
|
SyncFlavors syncs the open stack s flavors data in the system*/
|
||
|
SyncFlavors(ctx context.Context, params *SyncFlavorsParams) (*SyncFlavorsOK, *SyncFlavorsAccepted, error)
|
||
|
/*
|
||
|
SyncHierarchy syncs all the organizations projects resources hierarchy from l e x i s*/
|
||
|
SyncHierarchy(ctx context.Context, params *SyncHierarchyParams) (*SyncHierarchyOK, *SyncHierarchyAccepted, error)
|
||
|
}
|
||
|
|
||
|
// New creates a new sync management API client.
|
||
|
func New(transport runtime.ClientTransport, formats strfmt.Registry, authInfo runtime.ClientAuthInfoWriter) *Client {
|
||
|
return &Client{
|
||
|
transport: transport,
|
||
|
formats: formats,
|
||
|
authInfo: authInfo,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
Client for sync management API
|
||
|
*/
|
||
|
type Client struct {
|
||
|
transport runtime.ClientTransport
|
||
|
formats strfmt.Registry
|
||
|
authInfo runtime.ClientAuthInfoWriter
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
SyncFlavors syncs the open stack s flavors data in the system
|
||
|
*/
|
||
|
func (a *Client) SyncFlavors(ctx context.Context, params *SyncFlavorsParams) (*SyncFlavorsOK, *SyncFlavorsAccepted, error) {
|
||
|
|
||
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||
|
ID: "syncFlavors",
|
||
|
Method: "GET",
|
||
|
PathPattern: "/sync/flavors",
|
||
|
ProducesMediaTypes: []string{"application/json"},
|
||
|
ConsumesMediaTypes: []string{"application/json"},
|
||
|
Schemes: []string{"http", "https"},
|
||
|
Params: params,
|
||
|
Reader: &SyncFlavorsReader{formats: a.formats},
|
||
|
AuthInfo: a.authInfo,
|
||
|
Context: ctx,
|
||
|
Client: params.HTTPClient,
|
||
|
})
|
||
|
if err != nil {
|
||
|
return nil, nil, err
|
||
|
}
|
||
|
switch value := result.(type) {
|
||
|
case *SyncFlavorsOK:
|
||
|
return value, nil, nil
|
||
|
case *SyncFlavorsAccepted:
|
||
|
return nil, value, nil
|
||
|
}
|
||
|
return nil, nil, nil
|
||
|
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
SyncHierarchy syncs all the organizations projects resources hierarchy from l e x i s
|
||
|
*/
|
||
|
func (a *Client) SyncHierarchy(ctx context.Context, params *SyncHierarchyParams) (*SyncHierarchyOK, *SyncHierarchyAccepted, error) {
|
||
|
|
||
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||
|
ID: "syncHierarchy",
|
||
|
Method: "GET",
|
||
|
PathPattern: "/sync/hierarchy",
|
||
|
ProducesMediaTypes: []string{"application/json"},
|
||
|
ConsumesMediaTypes: []string{"application/json"},
|
||
|
Schemes: []string{"http", "https"},
|
||
|
Params: params,
|
||
|
Reader: &SyncHierarchyReader{formats: a.formats},
|
||
|
AuthInfo: a.authInfo,
|
||
|
Context: ctx,
|
||
|
Client: params.HTTPClient,
|
||
|
})
|
||
|
if err != nil {
|
||
|
return nil, nil, err
|
||
|
}
|
||
|
switch value := result.(type) {
|
||
|
case *SyncHierarchyOK:
|
||
|
return value, nil, nil
|
||
|
case *SyncHierarchyAccepted:
|
||
|
return nil, value, nil
|
||
|
}
|
||
|
return nil, nil, nil
|
||
|
|
||
|
}
|