forked from TrueCloudLab/frostfs-api-go
Airat Arifullin
9c0007fb1d
* Add type instance check for nil to avoid panic by accessing fields. Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
226 lines
3.6 KiB
Go
226 lines
3.6 KiB
Go
package apemanager
|
|
|
|
import (
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape"
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session"
|
|
)
|
|
|
|
type AddChainRequest struct {
|
|
body *AddChainRequestBody
|
|
|
|
session.RequestHeaders
|
|
}
|
|
|
|
func (r *AddChainRequest) SetBody(body *AddChainRequestBody) {
|
|
r.body = body
|
|
}
|
|
|
|
func (r *AddChainRequest) GetBody() *AddChainRequestBody {
|
|
if r == nil {
|
|
return nil
|
|
}
|
|
|
|
return r.body
|
|
}
|
|
|
|
type AddChainRequestBody struct {
|
|
target *ape.ChainTarget
|
|
|
|
chain *ape.Chain
|
|
}
|
|
|
|
func (rb *AddChainRequestBody) SetTarget(target *ape.ChainTarget) {
|
|
rb.target = target
|
|
}
|
|
|
|
func (rb *AddChainRequestBody) GetTarget() *ape.ChainTarget {
|
|
if rb == nil {
|
|
return nil
|
|
}
|
|
|
|
return rb.target
|
|
}
|
|
|
|
func (rb *AddChainRequestBody) SetChain(chain *ape.Chain) {
|
|
rb.chain = chain
|
|
}
|
|
|
|
func (rb *AddChainRequestBody) GetChain() *ape.Chain {
|
|
if rb == nil {
|
|
return nil
|
|
}
|
|
|
|
return rb.chain
|
|
}
|
|
|
|
type AddChainResponse struct {
|
|
body *AddChainResponseBody
|
|
|
|
session.ResponseHeaders
|
|
}
|
|
|
|
func (r *AddChainResponse) SetBody(body *AddChainResponseBody) {
|
|
r.body = body
|
|
}
|
|
|
|
func (r *AddChainResponse) GetBody() *AddChainResponseBody {
|
|
if r == nil {
|
|
return nil
|
|
}
|
|
|
|
return r.body
|
|
}
|
|
|
|
type AddChainResponseBody struct {
|
|
chainID []byte
|
|
}
|
|
|
|
func (rb *AddChainResponseBody) SetChainID(chainID []byte) {
|
|
rb.chainID = chainID
|
|
}
|
|
|
|
func (rb *AddChainResponseBody) GetChainID() []byte {
|
|
if rb == nil {
|
|
return nil
|
|
}
|
|
|
|
return rb.chainID
|
|
}
|
|
|
|
type RemoveChainRequest struct {
|
|
body *RemoveChainRequestBody
|
|
|
|
session.RequestHeaders
|
|
}
|
|
|
|
func (r *RemoveChainRequest) SetBody(body *RemoveChainRequestBody) {
|
|
r.body = body
|
|
}
|
|
|
|
func (r *RemoveChainRequest) GetBody() *RemoveChainRequestBody {
|
|
if r == nil {
|
|
return nil
|
|
}
|
|
|
|
return r.body
|
|
}
|
|
|
|
type RemoveChainRequestBody struct {
|
|
target *ape.ChainTarget
|
|
|
|
chainID []byte
|
|
}
|
|
|
|
func (rb *RemoveChainRequestBody) SetTarget(target *ape.ChainTarget) {
|
|
rb.target = target
|
|
}
|
|
|
|
func (rb *RemoveChainRequestBody) GetTarget() *ape.ChainTarget {
|
|
if rb == nil {
|
|
return nil
|
|
}
|
|
|
|
return rb.target
|
|
}
|
|
|
|
func (rb *RemoveChainRequestBody) SetChainID(chainID []byte) {
|
|
rb.chainID = chainID
|
|
}
|
|
|
|
func (rb *RemoveChainRequestBody) GetChainID() []byte {
|
|
if rb == nil {
|
|
return nil
|
|
}
|
|
|
|
return rb.chainID
|
|
}
|
|
|
|
type RemoveChainResponse struct {
|
|
body *RemoveChainResponseBody
|
|
|
|
session.ResponseHeaders
|
|
}
|
|
|
|
type RemoveChainResponseBody struct{}
|
|
|
|
func (r *RemoveChainResponse) SetBody(body *RemoveChainResponseBody) {
|
|
r.body = body
|
|
}
|
|
|
|
func (r *RemoveChainResponse) GetBody() *RemoveChainResponseBody {
|
|
if r == nil {
|
|
return nil
|
|
}
|
|
|
|
return r.body
|
|
}
|
|
|
|
type ListChainsRequest struct {
|
|
body *ListChainsRequestBody
|
|
|
|
session.RequestHeaders
|
|
}
|
|
|
|
func (r *ListChainsRequest) SetBody(body *ListChainsRequestBody) {
|
|
r.body = body
|
|
}
|
|
|
|
func (r *ListChainsRequest) GetBody() *ListChainsRequestBody {
|
|
if r == nil {
|
|
return nil
|
|
}
|
|
|
|
return r.body
|
|
}
|
|
|
|
type ListChainsRequestBody struct {
|
|
target *ape.ChainTarget
|
|
}
|
|
|
|
func (rb *ListChainsRequestBody) SetTarget(target *ape.ChainTarget) {
|
|
rb.target = target
|
|
}
|
|
|
|
func (rb *ListChainsRequestBody) GetTarget() *ape.ChainTarget {
|
|
if rb == nil {
|
|
return nil
|
|
}
|
|
|
|
return rb.target
|
|
}
|
|
|
|
type ListChainsResponse struct {
|
|
body *ListChainsResponseBody
|
|
|
|
session.ResponseHeaders
|
|
}
|
|
|
|
func (r *ListChainsResponse) SetBody(body *ListChainsResponseBody) {
|
|
r.body = body
|
|
}
|
|
|
|
func (r *ListChainsResponse) GetBody() *ListChainsResponseBody {
|
|
if r == nil {
|
|
return nil
|
|
}
|
|
|
|
return r.body
|
|
}
|
|
|
|
type ListChainsResponseBody struct {
|
|
chains []*ape.Chain
|
|
|
|
session.RequestHeaders
|
|
}
|
|
|
|
func (r *ListChainsResponseBody) SetChains(chains []*ape.Chain) {
|
|
r.chains = chains
|
|
}
|
|
|
|
func (r *ListChainsResponseBody) GetChains() []*ape.Chain {
|
|
if r == nil {
|
|
return nil
|
|
}
|
|
|
|
return r.chains
|
|
}
|