restructure rcloud-base as a single base controller (#37)

* restructure rcloud-base as a single base controller
* updated master.rest
* moved sentry from internal to pkg as it is used by relay
* removing unused rpc and it's dependencies
* Fix usermgmt tests
* Don't redefine variables in rest file
Co-authored-by: Abin Simon <abin.simon@rafay.co>
This commit is contained in:
nirav-rafay
2022-03-03 17:59:06 +05:30
committed by GitHub
parent 4ff3d06ef7
commit c66bdc25cd
1176 changed files with 9472 additions and 88767 deletions

View File

@@ -0,0 +1,117 @@
// Code generated by go-swagger; DO NOT EDIT.
package audit_information
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// New creates a new audit information API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for audit information API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
AuditInformationLookupCluster(params *AuditInformationLookupClusterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AuditInformationLookupClusterOK, error)
AuditInformationLookupUser(params *AuditInformationLookupUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AuditInformationLookupUserOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
AuditInformationLookupCluster audit information lookup cluster API
*/
func (a *Client) AuditInformationLookupCluster(params *AuditInformationLookupClusterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AuditInformationLookupClusterOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewAuditInformationLookupClusterParams()
}
op := &runtime.ClientOperation{
ID: "AuditInformation_LookupCluster",
Method: "GET",
PathPattern: "/v2/sentry/auditInfo/cluster",
ProducesMediaTypes: []string{"application/json", "application/yaml"},
ConsumesMediaTypes: []string{"application/json", "application/yaml"},
Schemes: []string{"https"},
Params: params,
Reader: &AuditInformationLookupClusterReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*AuditInformationLookupClusterOK)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*AuditInformationLookupClusterDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}
/*
AuditInformationLookupUser audit information lookup user API
*/
func (a *Client) AuditInformationLookupUser(params *AuditInformationLookupUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AuditInformationLookupUserOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewAuditInformationLookupUserParams()
}
op := &runtime.ClientOperation{
ID: "AuditInformation_LookupUser",
Method: "GET",
PathPattern: "/v2/sentry/auditInfo/user",
ProducesMediaTypes: []string{"application/json", "application/yaml"},
ConsumesMediaTypes: []string{"application/json", "application/yaml"},
Schemes: []string{"https"},
Params: params,
Reader: &AuditInformationLookupUserReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*AuditInformationLookupUserOK)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*AuditInformationLookupUserDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}
// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
a.transport = transport
}

View File

@@ -0,0 +1,158 @@
// Code generated by go-swagger; DO NOT EDIT.
package audit_information
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewAuditInformationLookupClusterParams creates a new AuditInformationLookupClusterParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewAuditInformationLookupClusterParams() *AuditInformationLookupClusterParams {
return &AuditInformationLookupClusterParams{
timeout: cr.DefaultTimeout,
}
}
// NewAuditInformationLookupClusterParamsWithTimeout creates a new AuditInformationLookupClusterParams object
// with the ability to set a timeout on a request.
func NewAuditInformationLookupClusterParamsWithTimeout(timeout time.Duration) *AuditInformationLookupClusterParams {
return &AuditInformationLookupClusterParams{
timeout: timeout,
}
}
// NewAuditInformationLookupClusterParamsWithContext creates a new AuditInformationLookupClusterParams object
// with the ability to set a context for a request.
func NewAuditInformationLookupClusterParamsWithContext(ctx context.Context) *AuditInformationLookupClusterParams {
return &AuditInformationLookupClusterParams{
Context: ctx,
}
}
// NewAuditInformationLookupClusterParamsWithHTTPClient creates a new AuditInformationLookupClusterParams object
// with the ability to set a custom HTTPClient for a request.
func NewAuditInformationLookupClusterParamsWithHTTPClient(client *http.Client) *AuditInformationLookupClusterParams {
return &AuditInformationLookupClusterParams{
HTTPClient: client,
}
}
/* AuditInformationLookupClusterParams contains all the parameters to send to the API endpoint
for the audit information lookup cluster operation.
Typically these are written to a http.Request.
*/
type AuditInformationLookupClusterParams struct {
// ClusterSNI.
ClusterSNI *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the audit information lookup cluster params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AuditInformationLookupClusterParams) WithDefaults() *AuditInformationLookupClusterParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the audit information lookup cluster params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AuditInformationLookupClusterParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the audit information lookup cluster params
func (o *AuditInformationLookupClusterParams) WithTimeout(timeout time.Duration) *AuditInformationLookupClusterParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the audit information lookup cluster params
func (o *AuditInformationLookupClusterParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the audit information lookup cluster params
func (o *AuditInformationLookupClusterParams) WithContext(ctx context.Context) *AuditInformationLookupClusterParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the audit information lookup cluster params
func (o *AuditInformationLookupClusterParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the audit information lookup cluster params
func (o *AuditInformationLookupClusterParams) WithHTTPClient(client *http.Client) *AuditInformationLookupClusterParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the audit information lookup cluster params
func (o *AuditInformationLookupClusterParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithClusterSNI adds the clusterSNI to the audit information lookup cluster params
func (o *AuditInformationLookupClusterParams) WithClusterSNI(clusterSNI *string) *AuditInformationLookupClusterParams {
o.SetClusterSNI(clusterSNI)
return o
}
// SetClusterSNI adds the clusterSNI to the audit information lookup cluster params
func (o *AuditInformationLookupClusterParams) SetClusterSNI(clusterSNI *string) {
o.ClusterSNI = clusterSNI
}
// WriteToRequest writes these params to a swagger request
func (o *AuditInformationLookupClusterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.ClusterSNI != nil {
// query param clusterSNI
var qrClusterSNI string
if o.ClusterSNI != nil {
qrClusterSNI = *o.ClusterSNI
}
qClusterSNI := qrClusterSNI
if qClusterSNI != "" {
if err := r.SetQueryParam("clusterSNI", qClusterSNI); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,187 @@
// Code generated by go-swagger; DO NOT EDIT.
package audit_information
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/models"
)
// AuditInformationLookupClusterReader is a Reader for the AuditInformationLookupCluster structure.
type AuditInformationLookupClusterReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *AuditInformationLookupClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewAuditInformationLookupClusterOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewAuditInformationLookupClusterForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewAuditInformationLookupClusterNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewAuditInformationLookupClusterDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewAuditInformationLookupClusterOK creates a AuditInformationLookupClusterOK with default headers values
func NewAuditInformationLookupClusterOK() *AuditInformationLookupClusterOK {
return &AuditInformationLookupClusterOK{}
}
/* AuditInformationLookupClusterOK describes a response with status code 200, with default header values.
A successful response.
*/
type AuditInformationLookupClusterOK struct {
Payload *models.RPCLookupClusterResponse
}
func (o *AuditInformationLookupClusterOK) Error() string {
return fmt.Sprintf("[GET /v2/sentry/auditInfo/cluster][%d] auditInformationLookupClusterOK %+v", 200, o.Payload)
}
func (o *AuditInformationLookupClusterOK) GetPayload() *models.RPCLookupClusterResponse {
return o.Payload
}
func (o *AuditInformationLookupClusterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.RPCLookupClusterResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAuditInformationLookupClusterForbidden creates a AuditInformationLookupClusterForbidden with default headers values
func NewAuditInformationLookupClusterForbidden() *AuditInformationLookupClusterForbidden {
return &AuditInformationLookupClusterForbidden{}
}
/* AuditInformationLookupClusterForbidden describes a response with status code 403, with default header values.
Returned when the user does not have permission to access the resource.
*/
type AuditInformationLookupClusterForbidden struct {
Payload interface{}
}
func (o *AuditInformationLookupClusterForbidden) Error() string {
return fmt.Sprintf("[GET /v2/sentry/auditInfo/cluster][%d] auditInformationLookupClusterForbidden %+v", 403, o.Payload)
}
func (o *AuditInformationLookupClusterForbidden) GetPayload() interface{} {
return o.Payload
}
func (o *AuditInformationLookupClusterForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAuditInformationLookupClusterNotFound creates a AuditInformationLookupClusterNotFound with default headers values
func NewAuditInformationLookupClusterNotFound() *AuditInformationLookupClusterNotFound {
return &AuditInformationLookupClusterNotFound{}
}
/* AuditInformationLookupClusterNotFound describes a response with status code 404, with default header values.
Returned when the resource does not exist.
*/
type AuditInformationLookupClusterNotFound struct {
Payload string
}
func (o *AuditInformationLookupClusterNotFound) Error() string {
return fmt.Sprintf("[GET /v2/sentry/auditInfo/cluster][%d] auditInformationLookupClusterNotFound %+v", 404, o.Payload)
}
func (o *AuditInformationLookupClusterNotFound) GetPayload() string {
return o.Payload
}
func (o *AuditInformationLookupClusterNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAuditInformationLookupClusterDefault creates a AuditInformationLookupClusterDefault with default headers values
func NewAuditInformationLookupClusterDefault(code int) *AuditInformationLookupClusterDefault {
return &AuditInformationLookupClusterDefault{
_statusCode: code,
}
}
/* AuditInformationLookupClusterDefault describes a response with status code -1, with default header values.
An unexpected error response.
*/
type AuditInformationLookupClusterDefault struct {
_statusCode int
Payload *models.GooglerpcStatus
}
// Code gets the status code for the audit information lookup cluster default response
func (o *AuditInformationLookupClusterDefault) Code() int {
return o._statusCode
}
func (o *AuditInformationLookupClusterDefault) Error() string {
return fmt.Sprintf("[GET /v2/sentry/auditInfo/cluster][%d] AuditInformation_LookupCluster default %+v", o._statusCode, o.Payload)
}
func (o *AuditInformationLookupClusterDefault) GetPayload() *models.GooglerpcStatus {
return o.Payload
}
func (o *AuditInformationLookupClusterDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.GooglerpcStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@@ -0,0 +1,158 @@
// Code generated by go-swagger; DO NOT EDIT.
package audit_information
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewAuditInformationLookupUserParams creates a new AuditInformationLookupUserParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewAuditInformationLookupUserParams() *AuditInformationLookupUserParams {
return &AuditInformationLookupUserParams{
timeout: cr.DefaultTimeout,
}
}
// NewAuditInformationLookupUserParamsWithTimeout creates a new AuditInformationLookupUserParams object
// with the ability to set a timeout on a request.
func NewAuditInformationLookupUserParamsWithTimeout(timeout time.Duration) *AuditInformationLookupUserParams {
return &AuditInformationLookupUserParams{
timeout: timeout,
}
}
// NewAuditInformationLookupUserParamsWithContext creates a new AuditInformationLookupUserParams object
// with the ability to set a context for a request.
func NewAuditInformationLookupUserParamsWithContext(ctx context.Context) *AuditInformationLookupUserParams {
return &AuditInformationLookupUserParams{
Context: ctx,
}
}
// NewAuditInformationLookupUserParamsWithHTTPClient creates a new AuditInformationLookupUserParams object
// with the ability to set a custom HTTPClient for a request.
func NewAuditInformationLookupUserParamsWithHTTPClient(client *http.Client) *AuditInformationLookupUserParams {
return &AuditInformationLookupUserParams{
HTTPClient: client,
}
}
/* AuditInformationLookupUserParams contains all the parameters to send to the API endpoint
for the audit information lookup user operation.
Typically these are written to a http.Request.
*/
type AuditInformationLookupUserParams struct {
// UserCN.
UserCN *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the audit information lookup user params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AuditInformationLookupUserParams) WithDefaults() *AuditInformationLookupUserParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the audit information lookup user params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AuditInformationLookupUserParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the audit information lookup user params
func (o *AuditInformationLookupUserParams) WithTimeout(timeout time.Duration) *AuditInformationLookupUserParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the audit information lookup user params
func (o *AuditInformationLookupUserParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the audit information lookup user params
func (o *AuditInformationLookupUserParams) WithContext(ctx context.Context) *AuditInformationLookupUserParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the audit information lookup user params
func (o *AuditInformationLookupUserParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the audit information lookup user params
func (o *AuditInformationLookupUserParams) WithHTTPClient(client *http.Client) *AuditInformationLookupUserParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the audit information lookup user params
func (o *AuditInformationLookupUserParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithUserCN adds the userCN to the audit information lookup user params
func (o *AuditInformationLookupUserParams) WithUserCN(userCN *string) *AuditInformationLookupUserParams {
o.SetUserCN(userCN)
return o
}
// SetUserCN adds the userCN to the audit information lookup user params
func (o *AuditInformationLookupUserParams) SetUserCN(userCN *string) {
o.UserCN = userCN
}
// WriteToRequest writes these params to a swagger request
func (o *AuditInformationLookupUserParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.UserCN != nil {
// query param userCN
var qrUserCN string
if o.UserCN != nil {
qrUserCN = *o.UserCN
}
qUserCN := qrUserCN
if qUserCN != "" {
if err := r.SetQueryParam("userCN", qUserCN); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,187 @@
// Code generated by go-swagger; DO NOT EDIT.
package audit_information
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/models"
)
// AuditInformationLookupUserReader is a Reader for the AuditInformationLookupUser structure.
type AuditInformationLookupUserReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *AuditInformationLookupUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewAuditInformationLookupUserOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewAuditInformationLookupUserForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewAuditInformationLookupUserNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewAuditInformationLookupUserDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewAuditInformationLookupUserOK creates a AuditInformationLookupUserOK with default headers values
func NewAuditInformationLookupUserOK() *AuditInformationLookupUserOK {
return &AuditInformationLookupUserOK{}
}
/* AuditInformationLookupUserOK describes a response with status code 200, with default header values.
A successful response.
*/
type AuditInformationLookupUserOK struct {
Payload *models.RPCLookupUserResponse
}
func (o *AuditInformationLookupUserOK) Error() string {
return fmt.Sprintf("[GET /v2/sentry/auditInfo/user][%d] auditInformationLookupUserOK %+v", 200, o.Payload)
}
func (o *AuditInformationLookupUserOK) GetPayload() *models.RPCLookupUserResponse {
return o.Payload
}
func (o *AuditInformationLookupUserOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.RPCLookupUserResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAuditInformationLookupUserForbidden creates a AuditInformationLookupUserForbidden with default headers values
func NewAuditInformationLookupUserForbidden() *AuditInformationLookupUserForbidden {
return &AuditInformationLookupUserForbidden{}
}
/* AuditInformationLookupUserForbidden describes a response with status code 403, with default header values.
Returned when the user does not have permission to access the resource.
*/
type AuditInformationLookupUserForbidden struct {
Payload interface{}
}
func (o *AuditInformationLookupUserForbidden) Error() string {
return fmt.Sprintf("[GET /v2/sentry/auditInfo/user][%d] auditInformationLookupUserForbidden %+v", 403, o.Payload)
}
func (o *AuditInformationLookupUserForbidden) GetPayload() interface{} {
return o.Payload
}
func (o *AuditInformationLookupUserForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAuditInformationLookupUserNotFound creates a AuditInformationLookupUserNotFound with default headers values
func NewAuditInformationLookupUserNotFound() *AuditInformationLookupUserNotFound {
return &AuditInformationLookupUserNotFound{}
}
/* AuditInformationLookupUserNotFound describes a response with status code 404, with default header values.
Returned when the resource does not exist.
*/
type AuditInformationLookupUserNotFound struct {
Payload string
}
func (o *AuditInformationLookupUserNotFound) Error() string {
return fmt.Sprintf("[GET /v2/sentry/auditInfo/user][%d] auditInformationLookupUserNotFound %+v", 404, o.Payload)
}
func (o *AuditInformationLookupUserNotFound) GetPayload() string {
return o.Payload
}
func (o *AuditInformationLookupUserNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAuditInformationLookupUserDefault creates a AuditInformationLookupUserDefault with default headers values
func NewAuditInformationLookupUserDefault(code int) *AuditInformationLookupUserDefault {
return &AuditInformationLookupUserDefault{
_statusCode: code,
}
}
/* AuditInformationLookupUserDefault describes a response with status code -1, with default header values.
An unexpected error response.
*/
type AuditInformationLookupUserDefault struct {
_statusCode int
Payload *models.GooglerpcStatus
}
// Code gets the status code for the audit information lookup user default response
func (o *AuditInformationLookupUserDefault) Code() int {
return o._statusCode
}
func (o *AuditInformationLookupUserDefault) Error() string {
return fmt.Sprintf("[GET /v2/sentry/auditInfo/user][%d] AuditInformation_LookupUser default %+v", o._statusCode, o.Payload)
}
func (o *AuditInformationLookupUserDefault) GetPayload() *models.GooglerpcStatus {
return o.Payload
}
func (o *AuditInformationLookupUserDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.GooglerpcStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@@ -0,0 +1,517 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// New creates a new bootstrap API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for bootstrap API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
BootstrapCreateBootstrapAgent(params *BootstrapCreateBootstrapAgentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapCreateBootstrapAgentOK, error)
BootstrapDeleteBootstrapAgent(params *BootstrapDeleteBootstrapAgentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapDeleteBootstrapAgentOK, error)
BootstrapGetBootstrapAgent(params *BootstrapGetBootstrapAgentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapGetBootstrapAgentOK, error)
BootstrapGetBootstrapAgentConfig(params *BootstrapGetBootstrapAgentConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapGetBootstrapAgentConfigOK, error)
BootstrapGetBootstrapAgentTemplate(params *BootstrapGetBootstrapAgentTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapGetBootstrapAgentTemplateOK, error)
BootstrapGetBootstrapAgentTemplates(params *BootstrapGetBootstrapAgentTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapGetBootstrapAgentTemplatesOK, error)
BootstrapGetBootstrapAgents(params *BootstrapGetBootstrapAgentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapGetBootstrapAgentsOK, error)
BootstrapGetBootstrapInfra(params *BootstrapGetBootstrapInfraParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapGetBootstrapInfraOK, error)
BootstrapPatchBootstrapAgentTemplate(params *BootstrapPatchBootstrapAgentTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapPatchBootstrapAgentTemplateOK, error)
BootstrapPatchBootstrapInfra(params *BootstrapPatchBootstrapInfraParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapPatchBootstrapInfraOK, error)
BootstrapRegisterBootstrapAgent(params *BootstrapRegisterBootstrapAgentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapRegisterBootstrapAgentOK, error)
BootstrapUpdateBootstrapAgent(params *BootstrapUpdateBootstrapAgentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapUpdateBootstrapAgentOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
BootstrapCreateBootstrapAgent bootstrap create bootstrap agent API
*/
func (a *Client) BootstrapCreateBootstrapAgent(params *BootstrapCreateBootstrapAgentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapCreateBootstrapAgentOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewBootstrapCreateBootstrapAgentParams()
}
op := &runtime.ClientOperation{
ID: "Bootstrap_CreateBootstrapAgent",
Method: "POST",
PathPattern: "/v2/sentry/bootstrap/{spec.templateRef}/agent",
ProducesMediaTypes: []string{"application/json", "application/yaml"},
ConsumesMediaTypes: []string{"application/json", "application/yaml"},
Schemes: []string{"https"},
Params: params,
Reader: &BootstrapCreateBootstrapAgentReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*BootstrapCreateBootstrapAgentOK)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*BootstrapCreateBootstrapAgentDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}
/*
BootstrapDeleteBootstrapAgent bootstrap delete bootstrap agent API
*/
func (a *Client) BootstrapDeleteBootstrapAgent(params *BootstrapDeleteBootstrapAgentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapDeleteBootstrapAgentOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewBootstrapDeleteBootstrapAgentParams()
}
op := &runtime.ClientOperation{
ID: "Bootstrap_DeleteBootstrapAgent",
Method: "DELETE",
PathPattern: "/v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}",
ProducesMediaTypes: []string{"application/json", "application/yaml"},
ConsumesMediaTypes: []string{"application/json", "application/yaml"},
Schemes: []string{"https"},
Params: params,
Reader: &BootstrapDeleteBootstrapAgentReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*BootstrapDeleteBootstrapAgentOK)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*BootstrapDeleteBootstrapAgentDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}
/*
BootstrapGetBootstrapAgent bootstrap get bootstrap agent API
*/
func (a *Client) BootstrapGetBootstrapAgent(params *BootstrapGetBootstrapAgentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapGetBootstrapAgentOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewBootstrapGetBootstrapAgentParams()
}
op := &runtime.ClientOperation{
ID: "Bootstrap_GetBootstrapAgent",
Method: "GET",
PathPattern: "/v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}",
ProducesMediaTypes: []string{"application/json", "application/yaml"},
ConsumesMediaTypes: []string{"application/json", "application/yaml"},
Schemes: []string{"https"},
Params: params,
Reader: &BootstrapGetBootstrapAgentReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*BootstrapGetBootstrapAgentOK)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*BootstrapGetBootstrapAgentDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}
/*
BootstrapGetBootstrapAgentConfig bootstrap get bootstrap agent config API
*/
func (a *Client) BootstrapGetBootstrapAgentConfig(params *BootstrapGetBootstrapAgentConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapGetBootstrapAgentConfigOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewBootstrapGetBootstrapAgentConfigParams()
}
op := &runtime.ClientOperation{
ID: "Bootstrap_GetBootstrapAgentConfig",
Method: "GET",
PathPattern: "/v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}/config",
ProducesMediaTypes: []string{"application/json", "application/yaml"},
ConsumesMediaTypes: []string{"application/json", "application/yaml"},
Schemes: []string{"https"},
Params: params,
Reader: &BootstrapGetBootstrapAgentConfigReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*BootstrapGetBootstrapAgentConfigOK)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*BootstrapGetBootstrapAgentConfigDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}
/*
BootstrapGetBootstrapAgentTemplate bootstrap get bootstrap agent template API
*/
func (a *Client) BootstrapGetBootstrapAgentTemplate(params *BootstrapGetBootstrapAgentTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapGetBootstrapAgentTemplateOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewBootstrapGetBootstrapAgentTemplateParams()
}
op := &runtime.ClientOperation{
ID: "Bootstrap_GetBootstrapAgentTemplate",
Method: "GET",
PathPattern: "/v2/sentry/bootstrap/template/{metadata.name}",
ProducesMediaTypes: []string{"application/json", "application/yaml"},
ConsumesMediaTypes: []string{"application/json", "application/yaml"},
Schemes: []string{"https"},
Params: params,
Reader: &BootstrapGetBootstrapAgentTemplateReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*BootstrapGetBootstrapAgentTemplateOK)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*BootstrapGetBootstrapAgentTemplateDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}
/*
BootstrapGetBootstrapAgentTemplates bootstrap get bootstrap agent templates API
*/
func (a *Client) BootstrapGetBootstrapAgentTemplates(params *BootstrapGetBootstrapAgentTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapGetBootstrapAgentTemplatesOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewBootstrapGetBootstrapAgentTemplatesParams()
}
op := &runtime.ClientOperation{
ID: "Bootstrap_GetBootstrapAgentTemplates",
Method: "GET",
PathPattern: "/v2/sentry/bootstrap/template",
ProducesMediaTypes: []string{"application/json", "application/yaml"},
ConsumesMediaTypes: []string{"application/json", "application/yaml"},
Schemes: []string{"https"},
Params: params,
Reader: &BootstrapGetBootstrapAgentTemplatesReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*BootstrapGetBootstrapAgentTemplatesOK)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*BootstrapGetBootstrapAgentTemplatesDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}
/*
BootstrapGetBootstrapAgents bootstrap get bootstrap agents API
*/
func (a *Client) BootstrapGetBootstrapAgents(params *BootstrapGetBootstrapAgentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapGetBootstrapAgentsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewBootstrapGetBootstrapAgentsParams()
}
op := &runtime.ClientOperation{
ID: "Bootstrap_GetBootstrapAgents",
Method: "GET",
PathPattern: "/v2/sentry/bootstrap/{templateScope}/agent",
ProducesMediaTypes: []string{"application/json", "application/yaml"},
ConsumesMediaTypes: []string{"application/json", "application/yaml"},
Schemes: []string{"https"},
Params: params,
Reader: &BootstrapGetBootstrapAgentsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*BootstrapGetBootstrapAgentsOK)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*BootstrapGetBootstrapAgentsDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}
/*
BootstrapGetBootstrapInfra bootstrap get bootstrap infra API
*/
func (a *Client) BootstrapGetBootstrapInfra(params *BootstrapGetBootstrapInfraParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapGetBootstrapInfraOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewBootstrapGetBootstrapInfraParams()
}
op := &runtime.ClientOperation{
ID: "Bootstrap_GetBootstrapInfra",
Method: "GET",
PathPattern: "/v2/sentry/bootstrap/infra/{metadata.name}",
ProducesMediaTypes: []string{"application/json", "application/yaml"},
ConsumesMediaTypes: []string{"application/json", "application/yaml"},
Schemes: []string{"https"},
Params: params,
Reader: &BootstrapGetBootstrapInfraReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*BootstrapGetBootstrapInfraOK)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*BootstrapGetBootstrapInfraDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}
/*
BootstrapPatchBootstrapAgentTemplate bootstrap patch bootstrap agent template API
*/
func (a *Client) BootstrapPatchBootstrapAgentTemplate(params *BootstrapPatchBootstrapAgentTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapPatchBootstrapAgentTemplateOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewBootstrapPatchBootstrapAgentTemplateParams()
}
op := &runtime.ClientOperation{
ID: "Bootstrap_PatchBootstrapAgentTemplate",
Method: "PUT",
PathPattern: "/v2/sentry/bootstrap/template/{metadata.name}",
ProducesMediaTypes: []string{"application/json", "application/yaml"},
ConsumesMediaTypes: []string{"application/json", "application/yaml"},
Schemes: []string{"https"},
Params: params,
Reader: &BootstrapPatchBootstrapAgentTemplateReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*BootstrapPatchBootstrapAgentTemplateOK)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*BootstrapPatchBootstrapAgentTemplateDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}
/*
BootstrapPatchBootstrapInfra bootstrap patch bootstrap infra API
*/
func (a *Client) BootstrapPatchBootstrapInfra(params *BootstrapPatchBootstrapInfraParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapPatchBootstrapInfraOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewBootstrapPatchBootstrapInfraParams()
}
op := &runtime.ClientOperation{
ID: "Bootstrap_PatchBootstrapInfra",
Method: "PUT",
PathPattern: "/v2/sentry/bootstrap/infra/{metadata.name}",
ProducesMediaTypes: []string{"application/json", "application/yaml"},
ConsumesMediaTypes: []string{"application/json", "application/yaml"},
Schemes: []string{"https"},
Params: params,
Reader: &BootstrapPatchBootstrapInfraReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*BootstrapPatchBootstrapInfraOK)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*BootstrapPatchBootstrapInfraDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}
/*
BootstrapRegisterBootstrapAgent bootstrap register bootstrap agent API
*/
func (a *Client) BootstrapRegisterBootstrapAgent(params *BootstrapRegisterBootstrapAgentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapRegisterBootstrapAgentOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewBootstrapRegisterBootstrapAgentParams()
}
op := &runtime.ClientOperation{
ID: "Bootstrap_RegisterBootstrapAgent",
Method: "POST",
PathPattern: "/v2/sentry/bootstrap/{templateToken}/register",
ProducesMediaTypes: []string{"application/json", "application/yaml"},
ConsumesMediaTypes: []string{"application/json", "application/yaml"},
Schemes: []string{"https"},
Params: params,
Reader: &BootstrapRegisterBootstrapAgentReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*BootstrapRegisterBootstrapAgentOK)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*BootstrapRegisterBootstrapAgentDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}
/*
BootstrapUpdateBootstrapAgent bootstrap update bootstrap agent API
*/
func (a *Client) BootstrapUpdateBootstrapAgent(params *BootstrapUpdateBootstrapAgentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BootstrapUpdateBootstrapAgentOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewBootstrapUpdateBootstrapAgentParams()
}
op := &runtime.ClientOperation{
ID: "Bootstrap_UpdateBootstrapAgent",
Method: "PUT",
PathPattern: "/v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}",
ProducesMediaTypes: []string{"application/json", "application/yaml"},
ConsumesMediaTypes: []string{"application/json", "application/yaml"},
Schemes: []string{"https"},
Params: params,
Reader: &BootstrapUpdateBootstrapAgentReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*BootstrapUpdateBootstrapAgentOK)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*BootstrapUpdateBootstrapAgentDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}
// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
a.transport = transport
}

View File

@@ -0,0 +1,167 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/models"
)
// NewBootstrapCreateBootstrapAgentParams creates a new BootstrapCreateBootstrapAgentParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewBootstrapCreateBootstrapAgentParams() *BootstrapCreateBootstrapAgentParams {
return &BootstrapCreateBootstrapAgentParams{
timeout: cr.DefaultTimeout,
}
}
// NewBootstrapCreateBootstrapAgentParamsWithTimeout creates a new BootstrapCreateBootstrapAgentParams object
// with the ability to set a timeout on a request.
func NewBootstrapCreateBootstrapAgentParamsWithTimeout(timeout time.Duration) *BootstrapCreateBootstrapAgentParams {
return &BootstrapCreateBootstrapAgentParams{
timeout: timeout,
}
}
// NewBootstrapCreateBootstrapAgentParamsWithContext creates a new BootstrapCreateBootstrapAgentParams object
// with the ability to set a context for a request.
func NewBootstrapCreateBootstrapAgentParamsWithContext(ctx context.Context) *BootstrapCreateBootstrapAgentParams {
return &BootstrapCreateBootstrapAgentParams{
Context: ctx,
}
}
// NewBootstrapCreateBootstrapAgentParamsWithHTTPClient creates a new BootstrapCreateBootstrapAgentParams object
// with the ability to set a custom HTTPClient for a request.
func NewBootstrapCreateBootstrapAgentParamsWithHTTPClient(client *http.Client) *BootstrapCreateBootstrapAgentParams {
return &BootstrapCreateBootstrapAgentParams{
HTTPClient: client,
}
}
/* BootstrapCreateBootstrapAgentParams contains all the parameters to send to the API endpoint
for the bootstrap create bootstrap agent operation.
Typically these are written to a http.Request.
*/
type BootstrapCreateBootstrapAgentParams struct {
// Body.
Body *models.SentryBootstrapAgent
// SpecTemplateRef.
SpecTemplateRef string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the bootstrap create bootstrap agent params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapCreateBootstrapAgentParams) WithDefaults() *BootstrapCreateBootstrapAgentParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the bootstrap create bootstrap agent params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapCreateBootstrapAgentParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the bootstrap create bootstrap agent params
func (o *BootstrapCreateBootstrapAgentParams) WithTimeout(timeout time.Duration) *BootstrapCreateBootstrapAgentParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the bootstrap create bootstrap agent params
func (o *BootstrapCreateBootstrapAgentParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the bootstrap create bootstrap agent params
func (o *BootstrapCreateBootstrapAgentParams) WithContext(ctx context.Context) *BootstrapCreateBootstrapAgentParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the bootstrap create bootstrap agent params
func (o *BootstrapCreateBootstrapAgentParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the bootstrap create bootstrap agent params
func (o *BootstrapCreateBootstrapAgentParams) WithHTTPClient(client *http.Client) *BootstrapCreateBootstrapAgentParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the bootstrap create bootstrap agent params
func (o *BootstrapCreateBootstrapAgentParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the bootstrap create bootstrap agent params
func (o *BootstrapCreateBootstrapAgentParams) WithBody(body *models.SentryBootstrapAgent) *BootstrapCreateBootstrapAgentParams {
o.SetBody(body)
return o
}
// SetBody adds the body to the bootstrap create bootstrap agent params
func (o *BootstrapCreateBootstrapAgentParams) SetBody(body *models.SentryBootstrapAgent) {
o.Body = body
}
// WithSpecTemplateRef adds the specTemplateRef to the bootstrap create bootstrap agent params
func (o *BootstrapCreateBootstrapAgentParams) WithSpecTemplateRef(specTemplateRef string) *BootstrapCreateBootstrapAgentParams {
o.SetSpecTemplateRef(specTemplateRef)
return o
}
// SetSpecTemplateRef adds the specTemplateRef to the bootstrap create bootstrap agent params
func (o *BootstrapCreateBootstrapAgentParams) SetSpecTemplateRef(specTemplateRef string) {
o.SpecTemplateRef = specTemplateRef
}
// WriteToRequest writes these params to a swagger request
func (o *BootstrapCreateBootstrapAgentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Body != nil {
if err := r.SetBodyParam(o.Body); err != nil {
return err
}
}
// path param spec.templateRef
if err := r.SetPathParam("spec.templateRef", o.SpecTemplateRef); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,223 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/models"
)
// BootstrapCreateBootstrapAgentReader is a Reader for the BootstrapCreateBootstrapAgent structure.
type BootstrapCreateBootstrapAgentReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *BootstrapCreateBootstrapAgentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewBootstrapCreateBootstrapAgentOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewBootstrapCreateBootstrapAgentForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewBootstrapCreateBootstrapAgentNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewBootstrapCreateBootstrapAgentInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewBootstrapCreateBootstrapAgentDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewBootstrapCreateBootstrapAgentOK creates a BootstrapCreateBootstrapAgentOK with default headers values
func NewBootstrapCreateBootstrapAgentOK() *BootstrapCreateBootstrapAgentOK {
return &BootstrapCreateBootstrapAgentOK{}
}
/* BootstrapCreateBootstrapAgentOK describes a response with status code 200, with default header values.
A successful response.
*/
type BootstrapCreateBootstrapAgentOK struct {
Payload *models.SentryBootstrapAgent
}
func (o *BootstrapCreateBootstrapAgentOK) Error() string {
return fmt.Sprintf("[POST /v2/sentry/bootstrap/{spec.templateRef}/agent][%d] bootstrapCreateBootstrapAgentOK %+v", 200, o.Payload)
}
func (o *BootstrapCreateBootstrapAgentOK) GetPayload() *models.SentryBootstrapAgent {
return o.Payload
}
func (o *BootstrapCreateBootstrapAgentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.SentryBootstrapAgent)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapCreateBootstrapAgentForbidden creates a BootstrapCreateBootstrapAgentForbidden with default headers values
func NewBootstrapCreateBootstrapAgentForbidden() *BootstrapCreateBootstrapAgentForbidden {
return &BootstrapCreateBootstrapAgentForbidden{}
}
/* BootstrapCreateBootstrapAgentForbidden describes a response with status code 403, with default header values.
Returned when the user does not have permission to access the resource.
*/
type BootstrapCreateBootstrapAgentForbidden struct {
Payload interface{}
}
func (o *BootstrapCreateBootstrapAgentForbidden) Error() string {
return fmt.Sprintf("[POST /v2/sentry/bootstrap/{spec.templateRef}/agent][%d] bootstrapCreateBootstrapAgentForbidden %+v", 403, o.Payload)
}
func (o *BootstrapCreateBootstrapAgentForbidden) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapCreateBootstrapAgentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapCreateBootstrapAgentNotFound creates a BootstrapCreateBootstrapAgentNotFound with default headers values
func NewBootstrapCreateBootstrapAgentNotFound() *BootstrapCreateBootstrapAgentNotFound {
return &BootstrapCreateBootstrapAgentNotFound{}
}
/* BootstrapCreateBootstrapAgentNotFound describes a response with status code 404, with default header values.
Returned when the resource does not exist.
*/
type BootstrapCreateBootstrapAgentNotFound struct {
Payload interface{}
}
func (o *BootstrapCreateBootstrapAgentNotFound) Error() string {
return fmt.Sprintf("[POST /v2/sentry/bootstrap/{spec.templateRef}/agent][%d] bootstrapCreateBootstrapAgentNotFound %+v", 404, o.Payload)
}
func (o *BootstrapCreateBootstrapAgentNotFound) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapCreateBootstrapAgentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapCreateBootstrapAgentInternalServerError creates a BootstrapCreateBootstrapAgentInternalServerError with default headers values
func NewBootstrapCreateBootstrapAgentInternalServerError() *BootstrapCreateBootstrapAgentInternalServerError {
return &BootstrapCreateBootstrapAgentInternalServerError{}
}
/* BootstrapCreateBootstrapAgentInternalServerError describes a response with status code 500, with default header values.
Returned for internal server error
*/
type BootstrapCreateBootstrapAgentInternalServerError struct {
Payload interface{}
}
func (o *BootstrapCreateBootstrapAgentInternalServerError) Error() string {
return fmt.Sprintf("[POST /v2/sentry/bootstrap/{spec.templateRef}/agent][%d] bootstrapCreateBootstrapAgentInternalServerError %+v", 500, o.Payload)
}
func (o *BootstrapCreateBootstrapAgentInternalServerError) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapCreateBootstrapAgentInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapCreateBootstrapAgentDefault creates a BootstrapCreateBootstrapAgentDefault with default headers values
func NewBootstrapCreateBootstrapAgentDefault(code int) *BootstrapCreateBootstrapAgentDefault {
return &BootstrapCreateBootstrapAgentDefault{
_statusCode: code,
}
}
/* BootstrapCreateBootstrapAgentDefault describes a response with status code -1, with default header values.
An unexpected error response.
*/
type BootstrapCreateBootstrapAgentDefault struct {
_statusCode int
Payload *models.GooglerpcStatus
}
// Code gets the status code for the bootstrap create bootstrap agent default response
func (o *BootstrapCreateBootstrapAgentDefault) Code() int {
return o._statusCode
}
func (o *BootstrapCreateBootstrapAgentDefault) Error() string {
return fmt.Sprintf("[POST /v2/sentry/bootstrap/{spec.templateRef}/agent][%d] Bootstrap_CreateBootstrapAgent default %+v", o._statusCode, o.Payload)
}
func (o *BootstrapCreateBootstrapAgentDefault) GetPayload() *models.GooglerpcStatus {
return o.Payload
}
func (o *BootstrapCreateBootstrapAgentDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.GooglerpcStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@@ -0,0 +1,686 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewBootstrapDeleteBootstrapAgentParams creates a new BootstrapDeleteBootstrapAgentParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewBootstrapDeleteBootstrapAgentParams() *BootstrapDeleteBootstrapAgentParams {
return &BootstrapDeleteBootstrapAgentParams{
timeout: cr.DefaultTimeout,
}
}
// NewBootstrapDeleteBootstrapAgentParamsWithTimeout creates a new BootstrapDeleteBootstrapAgentParams object
// with the ability to set a timeout on a request.
func NewBootstrapDeleteBootstrapAgentParamsWithTimeout(timeout time.Duration) *BootstrapDeleteBootstrapAgentParams {
return &BootstrapDeleteBootstrapAgentParams{
timeout: timeout,
}
}
// NewBootstrapDeleteBootstrapAgentParamsWithContext creates a new BootstrapDeleteBootstrapAgentParams object
// with the ability to set a context for a request.
func NewBootstrapDeleteBootstrapAgentParamsWithContext(ctx context.Context) *BootstrapDeleteBootstrapAgentParams {
return &BootstrapDeleteBootstrapAgentParams{
Context: ctx,
}
}
// NewBootstrapDeleteBootstrapAgentParamsWithHTTPClient creates a new BootstrapDeleteBootstrapAgentParams object
// with the ability to set a custom HTTPClient for a request.
func NewBootstrapDeleteBootstrapAgentParamsWithHTTPClient(client *http.Client) *BootstrapDeleteBootstrapAgentParams {
return &BootstrapDeleteBootstrapAgentParams{
HTTPClient: client,
}
}
/* BootstrapDeleteBootstrapAgentParams contains all the parameters to send to the API endpoint
for the bootstrap delete bootstrap agent operation.
Typically these are written to a http.Request.
*/
type BootstrapDeleteBootstrapAgentParams struct {
/* APIVersion.
API Version. API Version of the resource
Default: "infra.k8smgmt.io/v3"
*/
APIVersion *string
/* Kind.
Kind. Kind of the resource
Default: "BootstrapAgent"
*/
Kind *string
/* MetadataDescription.
Description. description of the resource
*/
MetadataDescription *string
/* MetadataDisplayName.
Display Name. display name of the resource
*/
MetadataDisplayName *string
// MetadataID.
MetadataID *string
// MetadataModifiedAt.
//
// Format: date-time
MetadataModifiedAt *strfmt.DateTime
/* MetadataName.
name of the resource
*/
MetadataName string
/* MetadataOrganization.
Organization. Organization to which the resource belongs
*/
MetadataOrganization *string
/* MetadataPartner.
Partner. Partner to which the resource belongs
*/
MetadataPartner *string
/* MetadataProject.
Project. Project of the resource
*/
MetadataProject *string
// SpecAgentMode.
//
// Default: "InCluster"
SpecAgentMode *string
// SpecTemplateRef.
SpecTemplateRef string
// SpecToken.
SpecToken *string
// StatusFingerprint.
StatusFingerprint *string
// StatusIPAddress.
StatusIPAddress *string
// StatusLastCheckedIn.
//
// Format: date-time
StatusLastCheckedIn *strfmt.DateTime
// StatusTokenState.
//
// Default: "NotSet"
StatusTokenState *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the bootstrap delete bootstrap agent params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapDeleteBootstrapAgentParams) WithDefaults() *BootstrapDeleteBootstrapAgentParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the bootstrap delete bootstrap agent params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapDeleteBootstrapAgentParams) SetDefaults() {
var (
aPIVersionDefault = string("infra.k8smgmt.io/v3")
kindDefault = string("BootstrapAgent")
specAgentModeDefault = string("InCluster")
statusTokenStateDefault = string("NotSet")
)
val := BootstrapDeleteBootstrapAgentParams{
APIVersion: &aPIVersionDefault,
Kind: &kindDefault,
SpecAgentMode: &specAgentModeDefault,
StatusTokenState: &statusTokenStateDefault,
}
val.timeout = o.timeout
val.Context = o.Context
val.HTTPClient = o.HTTPClient
*o = val
}
// WithTimeout adds the timeout to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) WithTimeout(timeout time.Duration) *BootstrapDeleteBootstrapAgentParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) WithContext(ctx context.Context) *BootstrapDeleteBootstrapAgentParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) WithHTTPClient(client *http.Client) *BootstrapDeleteBootstrapAgentParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAPIVersion adds the aPIVersion to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) WithAPIVersion(aPIVersion *string) *BootstrapDeleteBootstrapAgentParams {
o.SetAPIVersion(aPIVersion)
return o
}
// SetAPIVersion adds the apiVersion to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) SetAPIVersion(aPIVersion *string) {
o.APIVersion = aPIVersion
}
// WithKind adds the kind to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) WithKind(kind *string) *BootstrapDeleteBootstrapAgentParams {
o.SetKind(kind)
return o
}
// SetKind adds the kind to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) SetKind(kind *string) {
o.Kind = kind
}
// WithMetadataDescription adds the metadataDescription to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) WithMetadataDescription(metadataDescription *string) *BootstrapDeleteBootstrapAgentParams {
o.SetMetadataDescription(metadataDescription)
return o
}
// SetMetadataDescription adds the metadataDescription to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) SetMetadataDescription(metadataDescription *string) {
o.MetadataDescription = metadataDescription
}
// WithMetadataDisplayName adds the metadataDisplayName to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) WithMetadataDisplayName(metadataDisplayName *string) *BootstrapDeleteBootstrapAgentParams {
o.SetMetadataDisplayName(metadataDisplayName)
return o
}
// SetMetadataDisplayName adds the metadataDisplayName to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) SetMetadataDisplayName(metadataDisplayName *string) {
o.MetadataDisplayName = metadataDisplayName
}
// WithMetadataID adds the metadataID to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) WithMetadataID(metadataID *string) *BootstrapDeleteBootstrapAgentParams {
o.SetMetadataID(metadataID)
return o
}
// SetMetadataID adds the metadataId to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) SetMetadataID(metadataID *string) {
o.MetadataID = metadataID
}
// WithMetadataModifiedAt adds the metadataModifiedAt to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) WithMetadataModifiedAt(metadataModifiedAt *strfmt.DateTime) *BootstrapDeleteBootstrapAgentParams {
o.SetMetadataModifiedAt(metadataModifiedAt)
return o
}
// SetMetadataModifiedAt adds the metadataModifiedAt to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) SetMetadataModifiedAt(metadataModifiedAt *strfmt.DateTime) {
o.MetadataModifiedAt = metadataModifiedAt
}
// WithMetadataName adds the metadataName to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) WithMetadataName(metadataName string) *BootstrapDeleteBootstrapAgentParams {
o.SetMetadataName(metadataName)
return o
}
// SetMetadataName adds the metadataName to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) SetMetadataName(metadataName string) {
o.MetadataName = metadataName
}
// WithMetadataOrganization adds the metadataOrganization to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) WithMetadataOrganization(metadataOrganization *string) *BootstrapDeleteBootstrapAgentParams {
o.SetMetadataOrganization(metadataOrganization)
return o
}
// SetMetadataOrganization adds the metadataOrganization to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) SetMetadataOrganization(metadataOrganization *string) {
o.MetadataOrganization = metadataOrganization
}
// WithMetadataPartner adds the metadataPartner to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) WithMetadataPartner(metadataPartner *string) *BootstrapDeleteBootstrapAgentParams {
o.SetMetadataPartner(metadataPartner)
return o
}
// SetMetadataPartner adds the metadataPartner to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) SetMetadataPartner(metadataPartner *string) {
o.MetadataPartner = metadataPartner
}
// WithMetadataProject adds the metadataProject to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) WithMetadataProject(metadataProject *string) *BootstrapDeleteBootstrapAgentParams {
o.SetMetadataProject(metadataProject)
return o
}
// SetMetadataProject adds the metadataProject to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) SetMetadataProject(metadataProject *string) {
o.MetadataProject = metadataProject
}
// WithSpecAgentMode adds the specAgentMode to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) WithSpecAgentMode(specAgentMode *string) *BootstrapDeleteBootstrapAgentParams {
o.SetSpecAgentMode(specAgentMode)
return o
}
// SetSpecAgentMode adds the specAgentMode to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) SetSpecAgentMode(specAgentMode *string) {
o.SpecAgentMode = specAgentMode
}
// WithSpecTemplateRef adds the specTemplateRef to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) WithSpecTemplateRef(specTemplateRef string) *BootstrapDeleteBootstrapAgentParams {
o.SetSpecTemplateRef(specTemplateRef)
return o
}
// SetSpecTemplateRef adds the specTemplateRef to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) SetSpecTemplateRef(specTemplateRef string) {
o.SpecTemplateRef = specTemplateRef
}
// WithSpecToken adds the specToken to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) WithSpecToken(specToken *string) *BootstrapDeleteBootstrapAgentParams {
o.SetSpecToken(specToken)
return o
}
// SetSpecToken adds the specToken to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) SetSpecToken(specToken *string) {
o.SpecToken = specToken
}
// WithStatusFingerprint adds the statusFingerprint to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) WithStatusFingerprint(statusFingerprint *string) *BootstrapDeleteBootstrapAgentParams {
o.SetStatusFingerprint(statusFingerprint)
return o
}
// SetStatusFingerprint adds the statusFingerprint to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) SetStatusFingerprint(statusFingerprint *string) {
o.StatusFingerprint = statusFingerprint
}
// WithStatusIPAddress adds the statusIPAddress to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) WithStatusIPAddress(statusIPAddress *string) *BootstrapDeleteBootstrapAgentParams {
o.SetStatusIPAddress(statusIPAddress)
return o
}
// SetStatusIPAddress adds the statusIpAddress to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) SetStatusIPAddress(statusIPAddress *string) {
o.StatusIPAddress = statusIPAddress
}
// WithStatusLastCheckedIn adds the statusLastCheckedIn to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) WithStatusLastCheckedIn(statusLastCheckedIn *strfmt.DateTime) *BootstrapDeleteBootstrapAgentParams {
o.SetStatusLastCheckedIn(statusLastCheckedIn)
return o
}
// SetStatusLastCheckedIn adds the statusLastCheckedIn to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) SetStatusLastCheckedIn(statusLastCheckedIn *strfmt.DateTime) {
o.StatusLastCheckedIn = statusLastCheckedIn
}
// WithStatusTokenState adds the statusTokenState to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) WithStatusTokenState(statusTokenState *string) *BootstrapDeleteBootstrapAgentParams {
o.SetStatusTokenState(statusTokenState)
return o
}
// SetStatusTokenState adds the statusTokenState to the bootstrap delete bootstrap agent params
func (o *BootstrapDeleteBootstrapAgentParams) SetStatusTokenState(statusTokenState *string) {
o.StatusTokenState = statusTokenState
}
// WriteToRequest writes these params to a swagger request
func (o *BootstrapDeleteBootstrapAgentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.APIVersion != nil {
// query param apiVersion
var qrAPIVersion string
if o.APIVersion != nil {
qrAPIVersion = *o.APIVersion
}
qAPIVersion := qrAPIVersion
if qAPIVersion != "" {
if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil {
return err
}
}
}
if o.Kind != nil {
// query param kind
var qrKind string
if o.Kind != nil {
qrKind = *o.Kind
}
qKind := qrKind
if qKind != "" {
if err := r.SetQueryParam("kind", qKind); err != nil {
return err
}
}
}
if o.MetadataDescription != nil {
// query param metadata.description
var qrMetadataDescription string
if o.MetadataDescription != nil {
qrMetadataDescription = *o.MetadataDescription
}
qMetadataDescription := qrMetadataDescription
if qMetadataDescription != "" {
if err := r.SetQueryParam("metadata.description", qMetadataDescription); err != nil {
return err
}
}
}
if o.MetadataDisplayName != nil {
// query param metadata.displayName
var qrMetadataDisplayName string
if o.MetadataDisplayName != nil {
qrMetadataDisplayName = *o.MetadataDisplayName
}
qMetadataDisplayName := qrMetadataDisplayName
if qMetadataDisplayName != "" {
if err := r.SetQueryParam("metadata.displayName", qMetadataDisplayName); err != nil {
return err
}
}
}
if o.MetadataID != nil {
// query param metadata.id
var qrMetadataID string
if o.MetadataID != nil {
qrMetadataID = *o.MetadataID
}
qMetadataID := qrMetadataID
if qMetadataID != "" {
if err := r.SetQueryParam("metadata.id", qMetadataID); err != nil {
return err
}
}
}
if o.MetadataModifiedAt != nil {
// query param metadata.modifiedAt
var qrMetadataModifiedAt strfmt.DateTime
if o.MetadataModifiedAt != nil {
qrMetadataModifiedAt = *o.MetadataModifiedAt
}
qMetadataModifiedAt := qrMetadataModifiedAt.String()
if qMetadataModifiedAt != "" {
if err := r.SetQueryParam("metadata.modifiedAt", qMetadataModifiedAt); err != nil {
return err
}
}
}
// path param metadata.name
if err := r.SetPathParam("metadata.name", o.MetadataName); err != nil {
return err
}
if o.MetadataOrganization != nil {
// query param metadata.organization
var qrMetadataOrganization string
if o.MetadataOrganization != nil {
qrMetadataOrganization = *o.MetadataOrganization
}
qMetadataOrganization := qrMetadataOrganization
if qMetadataOrganization != "" {
if err := r.SetQueryParam("metadata.organization", qMetadataOrganization); err != nil {
return err
}
}
}
if o.MetadataPartner != nil {
// query param metadata.partner
var qrMetadataPartner string
if o.MetadataPartner != nil {
qrMetadataPartner = *o.MetadataPartner
}
qMetadataPartner := qrMetadataPartner
if qMetadataPartner != "" {
if err := r.SetQueryParam("metadata.partner", qMetadataPartner); err != nil {
return err
}
}
}
if o.MetadataProject != nil {
// query param metadata.project
var qrMetadataProject string
if o.MetadataProject != nil {
qrMetadataProject = *o.MetadataProject
}
qMetadataProject := qrMetadataProject
if qMetadataProject != "" {
if err := r.SetQueryParam("metadata.project", qMetadataProject); err != nil {
return err
}
}
}
if o.SpecAgentMode != nil {
// query param spec.agentMode
var qrSpecAgentMode string
if o.SpecAgentMode != nil {
qrSpecAgentMode = *o.SpecAgentMode
}
qSpecAgentMode := qrSpecAgentMode
if qSpecAgentMode != "" {
if err := r.SetQueryParam("spec.agentMode", qSpecAgentMode); err != nil {
return err
}
}
}
// path param spec.templateRef
if err := r.SetPathParam("spec.templateRef", o.SpecTemplateRef); err != nil {
return err
}
if o.SpecToken != nil {
// query param spec.token
var qrSpecToken string
if o.SpecToken != nil {
qrSpecToken = *o.SpecToken
}
qSpecToken := qrSpecToken
if qSpecToken != "" {
if err := r.SetQueryParam("spec.token", qSpecToken); err != nil {
return err
}
}
}
if o.StatusFingerprint != nil {
// query param status.fingerprint
var qrStatusFingerprint string
if o.StatusFingerprint != nil {
qrStatusFingerprint = *o.StatusFingerprint
}
qStatusFingerprint := qrStatusFingerprint
if qStatusFingerprint != "" {
if err := r.SetQueryParam("status.fingerprint", qStatusFingerprint); err != nil {
return err
}
}
}
if o.StatusIPAddress != nil {
// query param status.ipAddress
var qrStatusIPAddress string
if o.StatusIPAddress != nil {
qrStatusIPAddress = *o.StatusIPAddress
}
qStatusIPAddress := qrStatusIPAddress
if qStatusIPAddress != "" {
if err := r.SetQueryParam("status.ipAddress", qStatusIPAddress); err != nil {
return err
}
}
}
if o.StatusLastCheckedIn != nil {
// query param status.lastCheckedIn
var qrStatusLastCheckedIn strfmt.DateTime
if o.StatusLastCheckedIn != nil {
qrStatusLastCheckedIn = *o.StatusLastCheckedIn
}
qStatusLastCheckedIn := qrStatusLastCheckedIn.String()
if qStatusLastCheckedIn != "" {
if err := r.SetQueryParam("status.lastCheckedIn", qStatusLastCheckedIn); err != nil {
return err
}
}
}
if o.StatusTokenState != nil {
// query param status.tokenState
var qrStatusTokenState string
if o.StatusTokenState != nil {
qrStatusTokenState = *o.StatusTokenState
}
qStatusTokenState := qrStatusTokenState
if qStatusTokenState != "" {
if err := r.SetQueryParam("status.tokenState", qStatusTokenState); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,221 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/models"
)
// BootstrapDeleteBootstrapAgentReader is a Reader for the BootstrapDeleteBootstrapAgent structure.
type BootstrapDeleteBootstrapAgentReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *BootstrapDeleteBootstrapAgentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewBootstrapDeleteBootstrapAgentOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewBootstrapDeleteBootstrapAgentForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewBootstrapDeleteBootstrapAgentNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewBootstrapDeleteBootstrapAgentInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewBootstrapDeleteBootstrapAgentDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewBootstrapDeleteBootstrapAgentOK creates a BootstrapDeleteBootstrapAgentOK with default headers values
func NewBootstrapDeleteBootstrapAgentOK() *BootstrapDeleteBootstrapAgentOK {
return &BootstrapDeleteBootstrapAgentOK{}
}
/* BootstrapDeleteBootstrapAgentOK describes a response with status code 200, with default header values.
A successful response.
*/
type BootstrapDeleteBootstrapAgentOK struct {
Payload models.RPCDeleteBootstrapAgentResponse
}
func (o *BootstrapDeleteBootstrapAgentOK) Error() string {
return fmt.Sprintf("[DELETE /v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}][%d] bootstrapDeleteBootstrapAgentOK %+v", 200, o.Payload)
}
func (o *BootstrapDeleteBootstrapAgentOK) GetPayload() models.RPCDeleteBootstrapAgentResponse {
return o.Payload
}
func (o *BootstrapDeleteBootstrapAgentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapDeleteBootstrapAgentForbidden creates a BootstrapDeleteBootstrapAgentForbidden with default headers values
func NewBootstrapDeleteBootstrapAgentForbidden() *BootstrapDeleteBootstrapAgentForbidden {
return &BootstrapDeleteBootstrapAgentForbidden{}
}
/* BootstrapDeleteBootstrapAgentForbidden describes a response with status code 403, with default header values.
Returned when the user does not have permission to access the resource.
*/
type BootstrapDeleteBootstrapAgentForbidden struct {
Payload interface{}
}
func (o *BootstrapDeleteBootstrapAgentForbidden) Error() string {
return fmt.Sprintf("[DELETE /v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}][%d] bootstrapDeleteBootstrapAgentForbidden %+v", 403, o.Payload)
}
func (o *BootstrapDeleteBootstrapAgentForbidden) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapDeleteBootstrapAgentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapDeleteBootstrapAgentNotFound creates a BootstrapDeleteBootstrapAgentNotFound with default headers values
func NewBootstrapDeleteBootstrapAgentNotFound() *BootstrapDeleteBootstrapAgentNotFound {
return &BootstrapDeleteBootstrapAgentNotFound{}
}
/* BootstrapDeleteBootstrapAgentNotFound describes a response with status code 404, with default header values.
Returned when the resource does not exist.
*/
type BootstrapDeleteBootstrapAgentNotFound struct {
Payload interface{}
}
func (o *BootstrapDeleteBootstrapAgentNotFound) Error() string {
return fmt.Sprintf("[DELETE /v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}][%d] bootstrapDeleteBootstrapAgentNotFound %+v", 404, o.Payload)
}
func (o *BootstrapDeleteBootstrapAgentNotFound) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapDeleteBootstrapAgentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapDeleteBootstrapAgentInternalServerError creates a BootstrapDeleteBootstrapAgentInternalServerError with default headers values
func NewBootstrapDeleteBootstrapAgentInternalServerError() *BootstrapDeleteBootstrapAgentInternalServerError {
return &BootstrapDeleteBootstrapAgentInternalServerError{}
}
/* BootstrapDeleteBootstrapAgentInternalServerError describes a response with status code 500, with default header values.
Returned for internal server error
*/
type BootstrapDeleteBootstrapAgentInternalServerError struct {
Payload interface{}
}
func (o *BootstrapDeleteBootstrapAgentInternalServerError) Error() string {
return fmt.Sprintf("[DELETE /v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}][%d] bootstrapDeleteBootstrapAgentInternalServerError %+v", 500, o.Payload)
}
func (o *BootstrapDeleteBootstrapAgentInternalServerError) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapDeleteBootstrapAgentInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapDeleteBootstrapAgentDefault creates a BootstrapDeleteBootstrapAgentDefault with default headers values
func NewBootstrapDeleteBootstrapAgentDefault(code int) *BootstrapDeleteBootstrapAgentDefault {
return &BootstrapDeleteBootstrapAgentDefault{
_statusCode: code,
}
}
/* BootstrapDeleteBootstrapAgentDefault describes a response with status code -1, with default header values.
An unexpected error response.
*/
type BootstrapDeleteBootstrapAgentDefault struct {
_statusCode int
Payload *models.GooglerpcStatus
}
// Code gets the status code for the bootstrap delete bootstrap agent default response
func (o *BootstrapDeleteBootstrapAgentDefault) Code() int {
return o._statusCode
}
func (o *BootstrapDeleteBootstrapAgentDefault) Error() string {
return fmt.Sprintf("[DELETE /v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}][%d] Bootstrap_DeleteBootstrapAgent default %+v", o._statusCode, o.Payload)
}
func (o *BootstrapDeleteBootstrapAgentDefault) GetPayload() *models.GooglerpcStatus {
return o.Payload
}
func (o *BootstrapDeleteBootstrapAgentDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.GooglerpcStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@@ -0,0 +1,686 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewBootstrapGetBootstrapAgentConfigParams creates a new BootstrapGetBootstrapAgentConfigParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewBootstrapGetBootstrapAgentConfigParams() *BootstrapGetBootstrapAgentConfigParams {
return &BootstrapGetBootstrapAgentConfigParams{
timeout: cr.DefaultTimeout,
}
}
// NewBootstrapGetBootstrapAgentConfigParamsWithTimeout creates a new BootstrapGetBootstrapAgentConfigParams object
// with the ability to set a timeout on a request.
func NewBootstrapGetBootstrapAgentConfigParamsWithTimeout(timeout time.Duration) *BootstrapGetBootstrapAgentConfigParams {
return &BootstrapGetBootstrapAgentConfigParams{
timeout: timeout,
}
}
// NewBootstrapGetBootstrapAgentConfigParamsWithContext creates a new BootstrapGetBootstrapAgentConfigParams object
// with the ability to set a context for a request.
func NewBootstrapGetBootstrapAgentConfigParamsWithContext(ctx context.Context) *BootstrapGetBootstrapAgentConfigParams {
return &BootstrapGetBootstrapAgentConfigParams{
Context: ctx,
}
}
// NewBootstrapGetBootstrapAgentConfigParamsWithHTTPClient creates a new BootstrapGetBootstrapAgentConfigParams object
// with the ability to set a custom HTTPClient for a request.
func NewBootstrapGetBootstrapAgentConfigParamsWithHTTPClient(client *http.Client) *BootstrapGetBootstrapAgentConfigParams {
return &BootstrapGetBootstrapAgentConfigParams{
HTTPClient: client,
}
}
/* BootstrapGetBootstrapAgentConfigParams contains all the parameters to send to the API endpoint
for the bootstrap get bootstrap agent config operation.
Typically these are written to a http.Request.
*/
type BootstrapGetBootstrapAgentConfigParams struct {
/* APIVersion.
API Version. API Version of the resource
Default: "infra.k8smgmt.io/v3"
*/
APIVersion *string
/* Kind.
Kind. Kind of the resource
Default: "BootstrapAgent"
*/
Kind *string
/* MetadataDescription.
Description. description of the resource
*/
MetadataDescription *string
/* MetadataDisplayName.
Display Name. display name of the resource
*/
MetadataDisplayName *string
// MetadataID.
MetadataID *string
// MetadataModifiedAt.
//
// Format: date-time
MetadataModifiedAt *strfmt.DateTime
/* MetadataName.
name of the resource
*/
MetadataName string
/* MetadataOrganization.
Organization. Organization to which the resource belongs
*/
MetadataOrganization *string
/* MetadataPartner.
Partner. Partner to which the resource belongs
*/
MetadataPartner *string
/* MetadataProject.
Project. Project of the resource
*/
MetadataProject *string
// SpecAgentMode.
//
// Default: "InCluster"
SpecAgentMode *string
// SpecTemplateRef.
SpecTemplateRef string
// SpecToken.
SpecToken *string
// StatusFingerprint.
StatusFingerprint *string
// StatusIPAddress.
StatusIPAddress *string
// StatusLastCheckedIn.
//
// Format: date-time
StatusLastCheckedIn *strfmt.DateTime
// StatusTokenState.
//
// Default: "NotSet"
StatusTokenState *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the bootstrap get bootstrap agent config params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapGetBootstrapAgentConfigParams) WithDefaults() *BootstrapGetBootstrapAgentConfigParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the bootstrap get bootstrap agent config params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapGetBootstrapAgentConfigParams) SetDefaults() {
var (
aPIVersionDefault = string("infra.k8smgmt.io/v3")
kindDefault = string("BootstrapAgent")
specAgentModeDefault = string("InCluster")
statusTokenStateDefault = string("NotSet")
)
val := BootstrapGetBootstrapAgentConfigParams{
APIVersion: &aPIVersionDefault,
Kind: &kindDefault,
SpecAgentMode: &specAgentModeDefault,
StatusTokenState: &statusTokenStateDefault,
}
val.timeout = o.timeout
val.Context = o.Context
val.HTTPClient = o.HTTPClient
*o = val
}
// WithTimeout adds the timeout to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) WithTimeout(timeout time.Duration) *BootstrapGetBootstrapAgentConfigParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) WithContext(ctx context.Context) *BootstrapGetBootstrapAgentConfigParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) WithHTTPClient(client *http.Client) *BootstrapGetBootstrapAgentConfigParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAPIVersion adds the aPIVersion to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) WithAPIVersion(aPIVersion *string) *BootstrapGetBootstrapAgentConfigParams {
o.SetAPIVersion(aPIVersion)
return o
}
// SetAPIVersion adds the apiVersion to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) SetAPIVersion(aPIVersion *string) {
o.APIVersion = aPIVersion
}
// WithKind adds the kind to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) WithKind(kind *string) *BootstrapGetBootstrapAgentConfigParams {
o.SetKind(kind)
return o
}
// SetKind adds the kind to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) SetKind(kind *string) {
o.Kind = kind
}
// WithMetadataDescription adds the metadataDescription to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) WithMetadataDescription(metadataDescription *string) *BootstrapGetBootstrapAgentConfigParams {
o.SetMetadataDescription(metadataDescription)
return o
}
// SetMetadataDescription adds the metadataDescription to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) SetMetadataDescription(metadataDescription *string) {
o.MetadataDescription = metadataDescription
}
// WithMetadataDisplayName adds the metadataDisplayName to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) WithMetadataDisplayName(metadataDisplayName *string) *BootstrapGetBootstrapAgentConfigParams {
o.SetMetadataDisplayName(metadataDisplayName)
return o
}
// SetMetadataDisplayName adds the metadataDisplayName to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) SetMetadataDisplayName(metadataDisplayName *string) {
o.MetadataDisplayName = metadataDisplayName
}
// WithMetadataID adds the metadataID to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) WithMetadataID(metadataID *string) *BootstrapGetBootstrapAgentConfigParams {
o.SetMetadataID(metadataID)
return o
}
// SetMetadataID adds the metadataId to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) SetMetadataID(metadataID *string) {
o.MetadataID = metadataID
}
// WithMetadataModifiedAt adds the metadataModifiedAt to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) WithMetadataModifiedAt(metadataModifiedAt *strfmt.DateTime) *BootstrapGetBootstrapAgentConfigParams {
o.SetMetadataModifiedAt(metadataModifiedAt)
return o
}
// SetMetadataModifiedAt adds the metadataModifiedAt to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) SetMetadataModifiedAt(metadataModifiedAt *strfmt.DateTime) {
o.MetadataModifiedAt = metadataModifiedAt
}
// WithMetadataName adds the metadataName to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) WithMetadataName(metadataName string) *BootstrapGetBootstrapAgentConfigParams {
o.SetMetadataName(metadataName)
return o
}
// SetMetadataName adds the metadataName to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) SetMetadataName(metadataName string) {
o.MetadataName = metadataName
}
// WithMetadataOrganization adds the metadataOrganization to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) WithMetadataOrganization(metadataOrganization *string) *BootstrapGetBootstrapAgentConfigParams {
o.SetMetadataOrganization(metadataOrganization)
return o
}
// SetMetadataOrganization adds the metadataOrganization to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) SetMetadataOrganization(metadataOrganization *string) {
o.MetadataOrganization = metadataOrganization
}
// WithMetadataPartner adds the metadataPartner to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) WithMetadataPartner(metadataPartner *string) *BootstrapGetBootstrapAgentConfigParams {
o.SetMetadataPartner(metadataPartner)
return o
}
// SetMetadataPartner adds the metadataPartner to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) SetMetadataPartner(metadataPartner *string) {
o.MetadataPartner = metadataPartner
}
// WithMetadataProject adds the metadataProject to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) WithMetadataProject(metadataProject *string) *BootstrapGetBootstrapAgentConfigParams {
o.SetMetadataProject(metadataProject)
return o
}
// SetMetadataProject adds the metadataProject to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) SetMetadataProject(metadataProject *string) {
o.MetadataProject = metadataProject
}
// WithSpecAgentMode adds the specAgentMode to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) WithSpecAgentMode(specAgentMode *string) *BootstrapGetBootstrapAgentConfigParams {
o.SetSpecAgentMode(specAgentMode)
return o
}
// SetSpecAgentMode adds the specAgentMode to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) SetSpecAgentMode(specAgentMode *string) {
o.SpecAgentMode = specAgentMode
}
// WithSpecTemplateRef adds the specTemplateRef to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) WithSpecTemplateRef(specTemplateRef string) *BootstrapGetBootstrapAgentConfigParams {
o.SetSpecTemplateRef(specTemplateRef)
return o
}
// SetSpecTemplateRef adds the specTemplateRef to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) SetSpecTemplateRef(specTemplateRef string) {
o.SpecTemplateRef = specTemplateRef
}
// WithSpecToken adds the specToken to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) WithSpecToken(specToken *string) *BootstrapGetBootstrapAgentConfigParams {
o.SetSpecToken(specToken)
return o
}
// SetSpecToken adds the specToken to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) SetSpecToken(specToken *string) {
o.SpecToken = specToken
}
// WithStatusFingerprint adds the statusFingerprint to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) WithStatusFingerprint(statusFingerprint *string) *BootstrapGetBootstrapAgentConfigParams {
o.SetStatusFingerprint(statusFingerprint)
return o
}
// SetStatusFingerprint adds the statusFingerprint to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) SetStatusFingerprint(statusFingerprint *string) {
o.StatusFingerprint = statusFingerprint
}
// WithStatusIPAddress adds the statusIPAddress to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) WithStatusIPAddress(statusIPAddress *string) *BootstrapGetBootstrapAgentConfigParams {
o.SetStatusIPAddress(statusIPAddress)
return o
}
// SetStatusIPAddress adds the statusIpAddress to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) SetStatusIPAddress(statusIPAddress *string) {
o.StatusIPAddress = statusIPAddress
}
// WithStatusLastCheckedIn adds the statusLastCheckedIn to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) WithStatusLastCheckedIn(statusLastCheckedIn *strfmt.DateTime) *BootstrapGetBootstrapAgentConfigParams {
o.SetStatusLastCheckedIn(statusLastCheckedIn)
return o
}
// SetStatusLastCheckedIn adds the statusLastCheckedIn to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) SetStatusLastCheckedIn(statusLastCheckedIn *strfmt.DateTime) {
o.StatusLastCheckedIn = statusLastCheckedIn
}
// WithStatusTokenState adds the statusTokenState to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) WithStatusTokenState(statusTokenState *string) *BootstrapGetBootstrapAgentConfigParams {
o.SetStatusTokenState(statusTokenState)
return o
}
// SetStatusTokenState adds the statusTokenState to the bootstrap get bootstrap agent config params
func (o *BootstrapGetBootstrapAgentConfigParams) SetStatusTokenState(statusTokenState *string) {
o.StatusTokenState = statusTokenState
}
// WriteToRequest writes these params to a swagger request
func (o *BootstrapGetBootstrapAgentConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.APIVersion != nil {
// query param apiVersion
var qrAPIVersion string
if o.APIVersion != nil {
qrAPIVersion = *o.APIVersion
}
qAPIVersion := qrAPIVersion
if qAPIVersion != "" {
if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil {
return err
}
}
}
if o.Kind != nil {
// query param kind
var qrKind string
if o.Kind != nil {
qrKind = *o.Kind
}
qKind := qrKind
if qKind != "" {
if err := r.SetQueryParam("kind", qKind); err != nil {
return err
}
}
}
if o.MetadataDescription != nil {
// query param metadata.description
var qrMetadataDescription string
if o.MetadataDescription != nil {
qrMetadataDescription = *o.MetadataDescription
}
qMetadataDescription := qrMetadataDescription
if qMetadataDescription != "" {
if err := r.SetQueryParam("metadata.description", qMetadataDescription); err != nil {
return err
}
}
}
if o.MetadataDisplayName != nil {
// query param metadata.displayName
var qrMetadataDisplayName string
if o.MetadataDisplayName != nil {
qrMetadataDisplayName = *o.MetadataDisplayName
}
qMetadataDisplayName := qrMetadataDisplayName
if qMetadataDisplayName != "" {
if err := r.SetQueryParam("metadata.displayName", qMetadataDisplayName); err != nil {
return err
}
}
}
if o.MetadataID != nil {
// query param metadata.id
var qrMetadataID string
if o.MetadataID != nil {
qrMetadataID = *o.MetadataID
}
qMetadataID := qrMetadataID
if qMetadataID != "" {
if err := r.SetQueryParam("metadata.id", qMetadataID); err != nil {
return err
}
}
}
if o.MetadataModifiedAt != nil {
// query param metadata.modifiedAt
var qrMetadataModifiedAt strfmt.DateTime
if o.MetadataModifiedAt != nil {
qrMetadataModifiedAt = *o.MetadataModifiedAt
}
qMetadataModifiedAt := qrMetadataModifiedAt.String()
if qMetadataModifiedAt != "" {
if err := r.SetQueryParam("metadata.modifiedAt", qMetadataModifiedAt); err != nil {
return err
}
}
}
// path param metadata.name
if err := r.SetPathParam("metadata.name", o.MetadataName); err != nil {
return err
}
if o.MetadataOrganization != nil {
// query param metadata.organization
var qrMetadataOrganization string
if o.MetadataOrganization != nil {
qrMetadataOrganization = *o.MetadataOrganization
}
qMetadataOrganization := qrMetadataOrganization
if qMetadataOrganization != "" {
if err := r.SetQueryParam("metadata.organization", qMetadataOrganization); err != nil {
return err
}
}
}
if o.MetadataPartner != nil {
// query param metadata.partner
var qrMetadataPartner string
if o.MetadataPartner != nil {
qrMetadataPartner = *o.MetadataPartner
}
qMetadataPartner := qrMetadataPartner
if qMetadataPartner != "" {
if err := r.SetQueryParam("metadata.partner", qMetadataPartner); err != nil {
return err
}
}
}
if o.MetadataProject != nil {
// query param metadata.project
var qrMetadataProject string
if o.MetadataProject != nil {
qrMetadataProject = *o.MetadataProject
}
qMetadataProject := qrMetadataProject
if qMetadataProject != "" {
if err := r.SetQueryParam("metadata.project", qMetadataProject); err != nil {
return err
}
}
}
if o.SpecAgentMode != nil {
// query param spec.agentMode
var qrSpecAgentMode string
if o.SpecAgentMode != nil {
qrSpecAgentMode = *o.SpecAgentMode
}
qSpecAgentMode := qrSpecAgentMode
if qSpecAgentMode != "" {
if err := r.SetQueryParam("spec.agentMode", qSpecAgentMode); err != nil {
return err
}
}
}
// path param spec.templateRef
if err := r.SetPathParam("spec.templateRef", o.SpecTemplateRef); err != nil {
return err
}
if o.SpecToken != nil {
// query param spec.token
var qrSpecToken string
if o.SpecToken != nil {
qrSpecToken = *o.SpecToken
}
qSpecToken := qrSpecToken
if qSpecToken != "" {
if err := r.SetQueryParam("spec.token", qSpecToken); err != nil {
return err
}
}
}
if o.StatusFingerprint != nil {
// query param status.fingerprint
var qrStatusFingerprint string
if o.StatusFingerprint != nil {
qrStatusFingerprint = *o.StatusFingerprint
}
qStatusFingerprint := qrStatusFingerprint
if qStatusFingerprint != "" {
if err := r.SetQueryParam("status.fingerprint", qStatusFingerprint); err != nil {
return err
}
}
}
if o.StatusIPAddress != nil {
// query param status.ipAddress
var qrStatusIPAddress string
if o.StatusIPAddress != nil {
qrStatusIPAddress = *o.StatusIPAddress
}
qStatusIPAddress := qrStatusIPAddress
if qStatusIPAddress != "" {
if err := r.SetQueryParam("status.ipAddress", qStatusIPAddress); err != nil {
return err
}
}
}
if o.StatusLastCheckedIn != nil {
// query param status.lastCheckedIn
var qrStatusLastCheckedIn strfmt.DateTime
if o.StatusLastCheckedIn != nil {
qrStatusLastCheckedIn = *o.StatusLastCheckedIn
}
qStatusLastCheckedIn := qrStatusLastCheckedIn.String()
if qStatusLastCheckedIn != "" {
if err := r.SetQueryParam("status.lastCheckedIn", qStatusLastCheckedIn); err != nil {
return err
}
}
}
if o.StatusTokenState != nil {
// query param status.tokenState
var qrStatusTokenState string
if o.StatusTokenState != nil {
qrStatusTokenState = *o.StatusTokenState
}
qStatusTokenState := qrStatusTokenState
if qStatusTokenState != "" {
if err := r.SetQueryParam("status.tokenState", qStatusTokenState); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,223 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/models"
)
// BootstrapGetBootstrapAgentConfigReader is a Reader for the BootstrapGetBootstrapAgentConfig structure.
type BootstrapGetBootstrapAgentConfigReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *BootstrapGetBootstrapAgentConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewBootstrapGetBootstrapAgentConfigOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewBootstrapGetBootstrapAgentConfigForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewBootstrapGetBootstrapAgentConfigNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewBootstrapGetBootstrapAgentConfigInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewBootstrapGetBootstrapAgentConfigDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewBootstrapGetBootstrapAgentConfigOK creates a BootstrapGetBootstrapAgentConfigOK with default headers values
func NewBootstrapGetBootstrapAgentConfigOK() *BootstrapGetBootstrapAgentConfigOK {
return &BootstrapGetBootstrapAgentConfigOK{}
}
/* BootstrapGetBootstrapAgentConfigOK describes a response with status code 200, with default header values.
A successful response.
*/
type BootstrapGetBootstrapAgentConfigOK struct {
Payload *models.V3HTTPBody
}
func (o *BootstrapGetBootstrapAgentConfigOK) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}/config][%d] bootstrapGetBootstrapAgentConfigOK %+v", 200, o.Payload)
}
func (o *BootstrapGetBootstrapAgentConfigOK) GetPayload() *models.V3HTTPBody {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.V3HTTPBody)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapAgentConfigForbidden creates a BootstrapGetBootstrapAgentConfigForbidden with default headers values
func NewBootstrapGetBootstrapAgentConfigForbidden() *BootstrapGetBootstrapAgentConfigForbidden {
return &BootstrapGetBootstrapAgentConfigForbidden{}
}
/* BootstrapGetBootstrapAgentConfigForbidden describes a response with status code 403, with default header values.
Returned when the user does not have permission to access the resource.
*/
type BootstrapGetBootstrapAgentConfigForbidden struct {
Payload interface{}
}
func (o *BootstrapGetBootstrapAgentConfigForbidden) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}/config][%d] bootstrapGetBootstrapAgentConfigForbidden %+v", 403, o.Payload)
}
func (o *BootstrapGetBootstrapAgentConfigForbidden) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentConfigForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapAgentConfigNotFound creates a BootstrapGetBootstrapAgentConfigNotFound with default headers values
func NewBootstrapGetBootstrapAgentConfigNotFound() *BootstrapGetBootstrapAgentConfigNotFound {
return &BootstrapGetBootstrapAgentConfigNotFound{}
}
/* BootstrapGetBootstrapAgentConfigNotFound describes a response with status code 404, with default header values.
Returned when the resource does not exist.
*/
type BootstrapGetBootstrapAgentConfigNotFound struct {
Payload interface{}
}
func (o *BootstrapGetBootstrapAgentConfigNotFound) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}/config][%d] bootstrapGetBootstrapAgentConfigNotFound %+v", 404, o.Payload)
}
func (o *BootstrapGetBootstrapAgentConfigNotFound) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentConfigNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapAgentConfigInternalServerError creates a BootstrapGetBootstrapAgentConfigInternalServerError with default headers values
func NewBootstrapGetBootstrapAgentConfigInternalServerError() *BootstrapGetBootstrapAgentConfigInternalServerError {
return &BootstrapGetBootstrapAgentConfigInternalServerError{}
}
/* BootstrapGetBootstrapAgentConfigInternalServerError describes a response with status code 500, with default header values.
Returned for internal server error
*/
type BootstrapGetBootstrapAgentConfigInternalServerError struct {
Payload interface{}
}
func (o *BootstrapGetBootstrapAgentConfigInternalServerError) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}/config][%d] bootstrapGetBootstrapAgentConfigInternalServerError %+v", 500, o.Payload)
}
func (o *BootstrapGetBootstrapAgentConfigInternalServerError) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentConfigInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapAgentConfigDefault creates a BootstrapGetBootstrapAgentConfigDefault with default headers values
func NewBootstrapGetBootstrapAgentConfigDefault(code int) *BootstrapGetBootstrapAgentConfigDefault {
return &BootstrapGetBootstrapAgentConfigDefault{
_statusCode: code,
}
}
/* BootstrapGetBootstrapAgentConfigDefault describes a response with status code -1, with default header values.
An unexpected error response.
*/
type BootstrapGetBootstrapAgentConfigDefault struct {
_statusCode int
Payload *models.GooglerpcStatus
}
// Code gets the status code for the bootstrap get bootstrap agent config default response
func (o *BootstrapGetBootstrapAgentConfigDefault) Code() int {
return o._statusCode
}
func (o *BootstrapGetBootstrapAgentConfigDefault) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}/config][%d] Bootstrap_GetBootstrapAgentConfig default %+v", o._statusCode, o.Payload)
}
func (o *BootstrapGetBootstrapAgentConfigDefault) GetPayload() *models.GooglerpcStatus {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentConfigDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.GooglerpcStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@@ -0,0 +1,686 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewBootstrapGetBootstrapAgentParams creates a new BootstrapGetBootstrapAgentParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewBootstrapGetBootstrapAgentParams() *BootstrapGetBootstrapAgentParams {
return &BootstrapGetBootstrapAgentParams{
timeout: cr.DefaultTimeout,
}
}
// NewBootstrapGetBootstrapAgentParamsWithTimeout creates a new BootstrapGetBootstrapAgentParams object
// with the ability to set a timeout on a request.
func NewBootstrapGetBootstrapAgentParamsWithTimeout(timeout time.Duration) *BootstrapGetBootstrapAgentParams {
return &BootstrapGetBootstrapAgentParams{
timeout: timeout,
}
}
// NewBootstrapGetBootstrapAgentParamsWithContext creates a new BootstrapGetBootstrapAgentParams object
// with the ability to set a context for a request.
func NewBootstrapGetBootstrapAgentParamsWithContext(ctx context.Context) *BootstrapGetBootstrapAgentParams {
return &BootstrapGetBootstrapAgentParams{
Context: ctx,
}
}
// NewBootstrapGetBootstrapAgentParamsWithHTTPClient creates a new BootstrapGetBootstrapAgentParams object
// with the ability to set a custom HTTPClient for a request.
func NewBootstrapGetBootstrapAgentParamsWithHTTPClient(client *http.Client) *BootstrapGetBootstrapAgentParams {
return &BootstrapGetBootstrapAgentParams{
HTTPClient: client,
}
}
/* BootstrapGetBootstrapAgentParams contains all the parameters to send to the API endpoint
for the bootstrap get bootstrap agent operation.
Typically these are written to a http.Request.
*/
type BootstrapGetBootstrapAgentParams struct {
/* APIVersion.
API Version. API Version of the resource
Default: "infra.k8smgmt.io/v3"
*/
APIVersion *string
/* Kind.
Kind. Kind of the resource
Default: "BootstrapAgent"
*/
Kind *string
/* MetadataDescription.
Description. description of the resource
*/
MetadataDescription *string
/* MetadataDisplayName.
Display Name. display name of the resource
*/
MetadataDisplayName *string
// MetadataID.
MetadataID *string
// MetadataModifiedAt.
//
// Format: date-time
MetadataModifiedAt *strfmt.DateTime
/* MetadataName.
name of the resource
*/
MetadataName string
/* MetadataOrganization.
Organization. Organization to which the resource belongs
*/
MetadataOrganization *string
/* MetadataPartner.
Partner. Partner to which the resource belongs
*/
MetadataPartner *string
/* MetadataProject.
Project. Project of the resource
*/
MetadataProject *string
// SpecAgentMode.
//
// Default: "InCluster"
SpecAgentMode *string
// SpecTemplateRef.
SpecTemplateRef string
// SpecToken.
SpecToken *string
// StatusFingerprint.
StatusFingerprint *string
// StatusIPAddress.
StatusIPAddress *string
// StatusLastCheckedIn.
//
// Format: date-time
StatusLastCheckedIn *strfmt.DateTime
// StatusTokenState.
//
// Default: "NotSet"
StatusTokenState *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the bootstrap get bootstrap agent params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapGetBootstrapAgentParams) WithDefaults() *BootstrapGetBootstrapAgentParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the bootstrap get bootstrap agent params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapGetBootstrapAgentParams) SetDefaults() {
var (
aPIVersionDefault = string("infra.k8smgmt.io/v3")
kindDefault = string("BootstrapAgent")
specAgentModeDefault = string("InCluster")
statusTokenStateDefault = string("NotSet")
)
val := BootstrapGetBootstrapAgentParams{
APIVersion: &aPIVersionDefault,
Kind: &kindDefault,
SpecAgentMode: &specAgentModeDefault,
StatusTokenState: &statusTokenStateDefault,
}
val.timeout = o.timeout
val.Context = o.Context
val.HTTPClient = o.HTTPClient
*o = val
}
// WithTimeout adds the timeout to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) WithTimeout(timeout time.Duration) *BootstrapGetBootstrapAgentParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) WithContext(ctx context.Context) *BootstrapGetBootstrapAgentParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) WithHTTPClient(client *http.Client) *BootstrapGetBootstrapAgentParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAPIVersion adds the aPIVersion to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) WithAPIVersion(aPIVersion *string) *BootstrapGetBootstrapAgentParams {
o.SetAPIVersion(aPIVersion)
return o
}
// SetAPIVersion adds the apiVersion to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) SetAPIVersion(aPIVersion *string) {
o.APIVersion = aPIVersion
}
// WithKind adds the kind to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) WithKind(kind *string) *BootstrapGetBootstrapAgentParams {
o.SetKind(kind)
return o
}
// SetKind adds the kind to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) SetKind(kind *string) {
o.Kind = kind
}
// WithMetadataDescription adds the metadataDescription to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) WithMetadataDescription(metadataDescription *string) *BootstrapGetBootstrapAgentParams {
o.SetMetadataDescription(metadataDescription)
return o
}
// SetMetadataDescription adds the metadataDescription to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) SetMetadataDescription(metadataDescription *string) {
o.MetadataDescription = metadataDescription
}
// WithMetadataDisplayName adds the metadataDisplayName to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) WithMetadataDisplayName(metadataDisplayName *string) *BootstrapGetBootstrapAgentParams {
o.SetMetadataDisplayName(metadataDisplayName)
return o
}
// SetMetadataDisplayName adds the metadataDisplayName to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) SetMetadataDisplayName(metadataDisplayName *string) {
o.MetadataDisplayName = metadataDisplayName
}
// WithMetadataID adds the metadataID to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) WithMetadataID(metadataID *string) *BootstrapGetBootstrapAgentParams {
o.SetMetadataID(metadataID)
return o
}
// SetMetadataID adds the metadataId to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) SetMetadataID(metadataID *string) {
o.MetadataID = metadataID
}
// WithMetadataModifiedAt adds the metadataModifiedAt to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) WithMetadataModifiedAt(metadataModifiedAt *strfmt.DateTime) *BootstrapGetBootstrapAgentParams {
o.SetMetadataModifiedAt(metadataModifiedAt)
return o
}
// SetMetadataModifiedAt adds the metadataModifiedAt to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) SetMetadataModifiedAt(metadataModifiedAt *strfmt.DateTime) {
o.MetadataModifiedAt = metadataModifiedAt
}
// WithMetadataName adds the metadataName to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) WithMetadataName(metadataName string) *BootstrapGetBootstrapAgentParams {
o.SetMetadataName(metadataName)
return o
}
// SetMetadataName adds the metadataName to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) SetMetadataName(metadataName string) {
o.MetadataName = metadataName
}
// WithMetadataOrganization adds the metadataOrganization to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) WithMetadataOrganization(metadataOrganization *string) *BootstrapGetBootstrapAgentParams {
o.SetMetadataOrganization(metadataOrganization)
return o
}
// SetMetadataOrganization adds the metadataOrganization to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) SetMetadataOrganization(metadataOrganization *string) {
o.MetadataOrganization = metadataOrganization
}
// WithMetadataPartner adds the metadataPartner to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) WithMetadataPartner(metadataPartner *string) *BootstrapGetBootstrapAgentParams {
o.SetMetadataPartner(metadataPartner)
return o
}
// SetMetadataPartner adds the metadataPartner to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) SetMetadataPartner(metadataPartner *string) {
o.MetadataPartner = metadataPartner
}
// WithMetadataProject adds the metadataProject to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) WithMetadataProject(metadataProject *string) *BootstrapGetBootstrapAgentParams {
o.SetMetadataProject(metadataProject)
return o
}
// SetMetadataProject adds the metadataProject to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) SetMetadataProject(metadataProject *string) {
o.MetadataProject = metadataProject
}
// WithSpecAgentMode adds the specAgentMode to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) WithSpecAgentMode(specAgentMode *string) *BootstrapGetBootstrapAgentParams {
o.SetSpecAgentMode(specAgentMode)
return o
}
// SetSpecAgentMode adds the specAgentMode to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) SetSpecAgentMode(specAgentMode *string) {
o.SpecAgentMode = specAgentMode
}
// WithSpecTemplateRef adds the specTemplateRef to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) WithSpecTemplateRef(specTemplateRef string) *BootstrapGetBootstrapAgentParams {
o.SetSpecTemplateRef(specTemplateRef)
return o
}
// SetSpecTemplateRef adds the specTemplateRef to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) SetSpecTemplateRef(specTemplateRef string) {
o.SpecTemplateRef = specTemplateRef
}
// WithSpecToken adds the specToken to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) WithSpecToken(specToken *string) *BootstrapGetBootstrapAgentParams {
o.SetSpecToken(specToken)
return o
}
// SetSpecToken adds the specToken to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) SetSpecToken(specToken *string) {
o.SpecToken = specToken
}
// WithStatusFingerprint adds the statusFingerprint to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) WithStatusFingerprint(statusFingerprint *string) *BootstrapGetBootstrapAgentParams {
o.SetStatusFingerprint(statusFingerprint)
return o
}
// SetStatusFingerprint adds the statusFingerprint to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) SetStatusFingerprint(statusFingerprint *string) {
o.StatusFingerprint = statusFingerprint
}
// WithStatusIPAddress adds the statusIPAddress to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) WithStatusIPAddress(statusIPAddress *string) *BootstrapGetBootstrapAgentParams {
o.SetStatusIPAddress(statusIPAddress)
return o
}
// SetStatusIPAddress adds the statusIpAddress to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) SetStatusIPAddress(statusIPAddress *string) {
o.StatusIPAddress = statusIPAddress
}
// WithStatusLastCheckedIn adds the statusLastCheckedIn to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) WithStatusLastCheckedIn(statusLastCheckedIn *strfmt.DateTime) *BootstrapGetBootstrapAgentParams {
o.SetStatusLastCheckedIn(statusLastCheckedIn)
return o
}
// SetStatusLastCheckedIn adds the statusLastCheckedIn to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) SetStatusLastCheckedIn(statusLastCheckedIn *strfmt.DateTime) {
o.StatusLastCheckedIn = statusLastCheckedIn
}
// WithStatusTokenState adds the statusTokenState to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) WithStatusTokenState(statusTokenState *string) *BootstrapGetBootstrapAgentParams {
o.SetStatusTokenState(statusTokenState)
return o
}
// SetStatusTokenState adds the statusTokenState to the bootstrap get bootstrap agent params
func (o *BootstrapGetBootstrapAgentParams) SetStatusTokenState(statusTokenState *string) {
o.StatusTokenState = statusTokenState
}
// WriteToRequest writes these params to a swagger request
func (o *BootstrapGetBootstrapAgentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.APIVersion != nil {
// query param apiVersion
var qrAPIVersion string
if o.APIVersion != nil {
qrAPIVersion = *o.APIVersion
}
qAPIVersion := qrAPIVersion
if qAPIVersion != "" {
if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil {
return err
}
}
}
if o.Kind != nil {
// query param kind
var qrKind string
if o.Kind != nil {
qrKind = *o.Kind
}
qKind := qrKind
if qKind != "" {
if err := r.SetQueryParam("kind", qKind); err != nil {
return err
}
}
}
if o.MetadataDescription != nil {
// query param metadata.description
var qrMetadataDescription string
if o.MetadataDescription != nil {
qrMetadataDescription = *o.MetadataDescription
}
qMetadataDescription := qrMetadataDescription
if qMetadataDescription != "" {
if err := r.SetQueryParam("metadata.description", qMetadataDescription); err != nil {
return err
}
}
}
if o.MetadataDisplayName != nil {
// query param metadata.displayName
var qrMetadataDisplayName string
if o.MetadataDisplayName != nil {
qrMetadataDisplayName = *o.MetadataDisplayName
}
qMetadataDisplayName := qrMetadataDisplayName
if qMetadataDisplayName != "" {
if err := r.SetQueryParam("metadata.displayName", qMetadataDisplayName); err != nil {
return err
}
}
}
if o.MetadataID != nil {
// query param metadata.id
var qrMetadataID string
if o.MetadataID != nil {
qrMetadataID = *o.MetadataID
}
qMetadataID := qrMetadataID
if qMetadataID != "" {
if err := r.SetQueryParam("metadata.id", qMetadataID); err != nil {
return err
}
}
}
if o.MetadataModifiedAt != nil {
// query param metadata.modifiedAt
var qrMetadataModifiedAt strfmt.DateTime
if o.MetadataModifiedAt != nil {
qrMetadataModifiedAt = *o.MetadataModifiedAt
}
qMetadataModifiedAt := qrMetadataModifiedAt.String()
if qMetadataModifiedAt != "" {
if err := r.SetQueryParam("metadata.modifiedAt", qMetadataModifiedAt); err != nil {
return err
}
}
}
// path param metadata.name
if err := r.SetPathParam("metadata.name", o.MetadataName); err != nil {
return err
}
if o.MetadataOrganization != nil {
// query param metadata.organization
var qrMetadataOrganization string
if o.MetadataOrganization != nil {
qrMetadataOrganization = *o.MetadataOrganization
}
qMetadataOrganization := qrMetadataOrganization
if qMetadataOrganization != "" {
if err := r.SetQueryParam("metadata.organization", qMetadataOrganization); err != nil {
return err
}
}
}
if o.MetadataPartner != nil {
// query param metadata.partner
var qrMetadataPartner string
if o.MetadataPartner != nil {
qrMetadataPartner = *o.MetadataPartner
}
qMetadataPartner := qrMetadataPartner
if qMetadataPartner != "" {
if err := r.SetQueryParam("metadata.partner", qMetadataPartner); err != nil {
return err
}
}
}
if o.MetadataProject != nil {
// query param metadata.project
var qrMetadataProject string
if o.MetadataProject != nil {
qrMetadataProject = *o.MetadataProject
}
qMetadataProject := qrMetadataProject
if qMetadataProject != "" {
if err := r.SetQueryParam("metadata.project", qMetadataProject); err != nil {
return err
}
}
}
if o.SpecAgentMode != nil {
// query param spec.agentMode
var qrSpecAgentMode string
if o.SpecAgentMode != nil {
qrSpecAgentMode = *o.SpecAgentMode
}
qSpecAgentMode := qrSpecAgentMode
if qSpecAgentMode != "" {
if err := r.SetQueryParam("spec.agentMode", qSpecAgentMode); err != nil {
return err
}
}
}
// path param spec.templateRef
if err := r.SetPathParam("spec.templateRef", o.SpecTemplateRef); err != nil {
return err
}
if o.SpecToken != nil {
// query param spec.token
var qrSpecToken string
if o.SpecToken != nil {
qrSpecToken = *o.SpecToken
}
qSpecToken := qrSpecToken
if qSpecToken != "" {
if err := r.SetQueryParam("spec.token", qSpecToken); err != nil {
return err
}
}
}
if o.StatusFingerprint != nil {
// query param status.fingerprint
var qrStatusFingerprint string
if o.StatusFingerprint != nil {
qrStatusFingerprint = *o.StatusFingerprint
}
qStatusFingerprint := qrStatusFingerprint
if qStatusFingerprint != "" {
if err := r.SetQueryParam("status.fingerprint", qStatusFingerprint); err != nil {
return err
}
}
}
if o.StatusIPAddress != nil {
// query param status.ipAddress
var qrStatusIPAddress string
if o.StatusIPAddress != nil {
qrStatusIPAddress = *o.StatusIPAddress
}
qStatusIPAddress := qrStatusIPAddress
if qStatusIPAddress != "" {
if err := r.SetQueryParam("status.ipAddress", qStatusIPAddress); err != nil {
return err
}
}
}
if o.StatusLastCheckedIn != nil {
// query param status.lastCheckedIn
var qrStatusLastCheckedIn strfmt.DateTime
if o.StatusLastCheckedIn != nil {
qrStatusLastCheckedIn = *o.StatusLastCheckedIn
}
qStatusLastCheckedIn := qrStatusLastCheckedIn.String()
if qStatusLastCheckedIn != "" {
if err := r.SetQueryParam("status.lastCheckedIn", qStatusLastCheckedIn); err != nil {
return err
}
}
}
if o.StatusTokenState != nil {
// query param status.tokenState
var qrStatusTokenState string
if o.StatusTokenState != nil {
qrStatusTokenState = *o.StatusTokenState
}
qStatusTokenState := qrStatusTokenState
if qStatusTokenState != "" {
if err := r.SetQueryParam("status.tokenState", qStatusTokenState); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,223 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/models"
)
// BootstrapGetBootstrapAgentReader is a Reader for the BootstrapGetBootstrapAgent structure.
type BootstrapGetBootstrapAgentReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *BootstrapGetBootstrapAgentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewBootstrapGetBootstrapAgentOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewBootstrapGetBootstrapAgentForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewBootstrapGetBootstrapAgentNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewBootstrapGetBootstrapAgentInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewBootstrapGetBootstrapAgentDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewBootstrapGetBootstrapAgentOK creates a BootstrapGetBootstrapAgentOK with default headers values
func NewBootstrapGetBootstrapAgentOK() *BootstrapGetBootstrapAgentOK {
return &BootstrapGetBootstrapAgentOK{}
}
/* BootstrapGetBootstrapAgentOK describes a response with status code 200, with default header values.
A successful response.
*/
type BootstrapGetBootstrapAgentOK struct {
Payload *models.SentryBootstrapAgent
}
func (o *BootstrapGetBootstrapAgentOK) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}][%d] bootstrapGetBootstrapAgentOK %+v", 200, o.Payload)
}
func (o *BootstrapGetBootstrapAgentOK) GetPayload() *models.SentryBootstrapAgent {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.SentryBootstrapAgent)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapAgentForbidden creates a BootstrapGetBootstrapAgentForbidden with default headers values
func NewBootstrapGetBootstrapAgentForbidden() *BootstrapGetBootstrapAgentForbidden {
return &BootstrapGetBootstrapAgentForbidden{}
}
/* BootstrapGetBootstrapAgentForbidden describes a response with status code 403, with default header values.
Returned when the user does not have permission to access the resource.
*/
type BootstrapGetBootstrapAgentForbidden struct {
Payload interface{}
}
func (o *BootstrapGetBootstrapAgentForbidden) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}][%d] bootstrapGetBootstrapAgentForbidden %+v", 403, o.Payload)
}
func (o *BootstrapGetBootstrapAgentForbidden) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapAgentNotFound creates a BootstrapGetBootstrapAgentNotFound with default headers values
func NewBootstrapGetBootstrapAgentNotFound() *BootstrapGetBootstrapAgentNotFound {
return &BootstrapGetBootstrapAgentNotFound{}
}
/* BootstrapGetBootstrapAgentNotFound describes a response with status code 404, with default header values.
Returned when the resource does not exist.
*/
type BootstrapGetBootstrapAgentNotFound struct {
Payload interface{}
}
func (o *BootstrapGetBootstrapAgentNotFound) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}][%d] bootstrapGetBootstrapAgentNotFound %+v", 404, o.Payload)
}
func (o *BootstrapGetBootstrapAgentNotFound) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapAgentInternalServerError creates a BootstrapGetBootstrapAgentInternalServerError with default headers values
func NewBootstrapGetBootstrapAgentInternalServerError() *BootstrapGetBootstrapAgentInternalServerError {
return &BootstrapGetBootstrapAgentInternalServerError{}
}
/* BootstrapGetBootstrapAgentInternalServerError describes a response with status code 500, with default header values.
Returned for internal server error
*/
type BootstrapGetBootstrapAgentInternalServerError struct {
Payload interface{}
}
func (o *BootstrapGetBootstrapAgentInternalServerError) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}][%d] bootstrapGetBootstrapAgentInternalServerError %+v", 500, o.Payload)
}
func (o *BootstrapGetBootstrapAgentInternalServerError) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapAgentDefault creates a BootstrapGetBootstrapAgentDefault with default headers values
func NewBootstrapGetBootstrapAgentDefault(code int) *BootstrapGetBootstrapAgentDefault {
return &BootstrapGetBootstrapAgentDefault{
_statusCode: code,
}
}
/* BootstrapGetBootstrapAgentDefault describes a response with status code -1, with default header values.
An unexpected error response.
*/
type BootstrapGetBootstrapAgentDefault struct {
_statusCode int
Payload *models.GooglerpcStatus
}
// Code gets the status code for the bootstrap get bootstrap agent default response
func (o *BootstrapGetBootstrapAgentDefault) Code() int {
return o._statusCode
}
func (o *BootstrapGetBootstrapAgentDefault) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}][%d] Bootstrap_GetBootstrapAgent default %+v", o._statusCode, o.Payload)
}
func (o *BootstrapGetBootstrapAgentDefault) GetPayload() *models.GooglerpcStatus {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.GooglerpcStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@@ -0,0 +1,723 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// NewBootstrapGetBootstrapAgentTemplateParams creates a new BootstrapGetBootstrapAgentTemplateParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewBootstrapGetBootstrapAgentTemplateParams() *BootstrapGetBootstrapAgentTemplateParams {
return &BootstrapGetBootstrapAgentTemplateParams{
timeout: cr.DefaultTimeout,
}
}
// NewBootstrapGetBootstrapAgentTemplateParamsWithTimeout creates a new BootstrapGetBootstrapAgentTemplateParams object
// with the ability to set a timeout on a request.
func NewBootstrapGetBootstrapAgentTemplateParamsWithTimeout(timeout time.Duration) *BootstrapGetBootstrapAgentTemplateParams {
return &BootstrapGetBootstrapAgentTemplateParams{
timeout: timeout,
}
}
// NewBootstrapGetBootstrapAgentTemplateParamsWithContext creates a new BootstrapGetBootstrapAgentTemplateParams object
// with the ability to set a context for a request.
func NewBootstrapGetBootstrapAgentTemplateParamsWithContext(ctx context.Context) *BootstrapGetBootstrapAgentTemplateParams {
return &BootstrapGetBootstrapAgentTemplateParams{
Context: ctx,
}
}
// NewBootstrapGetBootstrapAgentTemplateParamsWithHTTPClient creates a new BootstrapGetBootstrapAgentTemplateParams object
// with the ability to set a custom HTTPClient for a request.
func NewBootstrapGetBootstrapAgentTemplateParamsWithHTTPClient(client *http.Client) *BootstrapGetBootstrapAgentTemplateParams {
return &BootstrapGetBootstrapAgentTemplateParams{
HTTPClient: client,
}
}
/* BootstrapGetBootstrapAgentTemplateParams contains all the parameters to send to the API endpoint
for the bootstrap get bootstrap agent template operation.
Typically these are written to a http.Request.
*/
type BootstrapGetBootstrapAgentTemplateParams struct {
/* APIVersion.
API Version. API Version of the resource
Default: "infra.k8smgmt.io/v3"
*/
APIVersion *string
/* Kind.
Kind. Kind of the resource
Default: "BootstrapAgentTemplate"
*/
Kind *string
/* MetadataDescription.
Description. description of the resource
*/
MetadataDescription *string
/* MetadataDisplayName.
Display Name. display name of the resource
*/
MetadataDisplayName *string
// MetadataID.
MetadataID *string
// MetadataModifiedAt.
//
// Format: date-time
MetadataModifiedAt *strfmt.DateTime
/* MetadataName.
name of the resource
*/
MetadataName string
/* MetadataOrganization.
Organization. Organization to which the resource belongs
*/
MetadataOrganization *string
/* MetadataPartner.
Partner. Partner to which the resource belongs
*/
MetadataPartner *string
/* MetadataProject.
Project. Project of the resource
*/
MetadataProject *string
// SpecAutoApprove.
SpecAutoApprove *bool
// SpecAutoRegister.
SpecAutoRegister *bool
// SpecIgnoreMultipleRegister.
SpecIgnoreMultipleRegister *bool
// SpecInClusterTemplate.
SpecInClusterTemplate *string
// SpecInfraRef.
SpecInfraRef *string
// SpecOutOfClusterTemplate.
SpecOutOfClusterTemplate *string
// SpecTemplateType.
//
// Default: "TemplateTypeNotSet"
SpecTemplateType *string
// SpecToken.
SpecToken *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the bootstrap get bootstrap agent template params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapGetBootstrapAgentTemplateParams) WithDefaults() *BootstrapGetBootstrapAgentTemplateParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the bootstrap get bootstrap agent template params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapGetBootstrapAgentTemplateParams) SetDefaults() {
var (
aPIVersionDefault = string("infra.k8smgmt.io/v3")
kindDefault = string("BootstrapAgentTemplate")
specTemplateTypeDefault = string("TemplateTypeNotSet")
)
val := BootstrapGetBootstrapAgentTemplateParams{
APIVersion: &aPIVersionDefault,
Kind: &kindDefault,
SpecTemplateType: &specTemplateTypeDefault,
}
val.timeout = o.timeout
val.Context = o.Context
val.HTTPClient = o.HTTPClient
*o = val
}
// WithTimeout adds the timeout to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) WithTimeout(timeout time.Duration) *BootstrapGetBootstrapAgentTemplateParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) WithContext(ctx context.Context) *BootstrapGetBootstrapAgentTemplateParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) WithHTTPClient(client *http.Client) *BootstrapGetBootstrapAgentTemplateParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAPIVersion adds the aPIVersion to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) WithAPIVersion(aPIVersion *string) *BootstrapGetBootstrapAgentTemplateParams {
o.SetAPIVersion(aPIVersion)
return o
}
// SetAPIVersion adds the apiVersion to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) SetAPIVersion(aPIVersion *string) {
o.APIVersion = aPIVersion
}
// WithKind adds the kind to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) WithKind(kind *string) *BootstrapGetBootstrapAgentTemplateParams {
o.SetKind(kind)
return o
}
// SetKind adds the kind to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) SetKind(kind *string) {
o.Kind = kind
}
// WithMetadataDescription adds the metadataDescription to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) WithMetadataDescription(metadataDescription *string) *BootstrapGetBootstrapAgentTemplateParams {
o.SetMetadataDescription(metadataDescription)
return o
}
// SetMetadataDescription adds the metadataDescription to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) SetMetadataDescription(metadataDescription *string) {
o.MetadataDescription = metadataDescription
}
// WithMetadataDisplayName adds the metadataDisplayName to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) WithMetadataDisplayName(metadataDisplayName *string) *BootstrapGetBootstrapAgentTemplateParams {
o.SetMetadataDisplayName(metadataDisplayName)
return o
}
// SetMetadataDisplayName adds the metadataDisplayName to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) SetMetadataDisplayName(metadataDisplayName *string) {
o.MetadataDisplayName = metadataDisplayName
}
// WithMetadataID adds the metadataID to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) WithMetadataID(metadataID *string) *BootstrapGetBootstrapAgentTemplateParams {
o.SetMetadataID(metadataID)
return o
}
// SetMetadataID adds the metadataId to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) SetMetadataID(metadataID *string) {
o.MetadataID = metadataID
}
// WithMetadataModifiedAt adds the metadataModifiedAt to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) WithMetadataModifiedAt(metadataModifiedAt *strfmt.DateTime) *BootstrapGetBootstrapAgentTemplateParams {
o.SetMetadataModifiedAt(metadataModifiedAt)
return o
}
// SetMetadataModifiedAt adds the metadataModifiedAt to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) SetMetadataModifiedAt(metadataModifiedAt *strfmt.DateTime) {
o.MetadataModifiedAt = metadataModifiedAt
}
// WithMetadataName adds the metadataName to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) WithMetadataName(metadataName string) *BootstrapGetBootstrapAgentTemplateParams {
o.SetMetadataName(metadataName)
return o
}
// SetMetadataName adds the metadataName to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) SetMetadataName(metadataName string) {
o.MetadataName = metadataName
}
// WithMetadataOrganization adds the metadataOrganization to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) WithMetadataOrganization(metadataOrganization *string) *BootstrapGetBootstrapAgentTemplateParams {
o.SetMetadataOrganization(metadataOrganization)
return o
}
// SetMetadataOrganization adds the metadataOrganization to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) SetMetadataOrganization(metadataOrganization *string) {
o.MetadataOrganization = metadataOrganization
}
// WithMetadataPartner adds the metadataPartner to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) WithMetadataPartner(metadataPartner *string) *BootstrapGetBootstrapAgentTemplateParams {
o.SetMetadataPartner(metadataPartner)
return o
}
// SetMetadataPartner adds the metadataPartner to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) SetMetadataPartner(metadataPartner *string) {
o.MetadataPartner = metadataPartner
}
// WithMetadataProject adds the metadataProject to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) WithMetadataProject(metadataProject *string) *BootstrapGetBootstrapAgentTemplateParams {
o.SetMetadataProject(metadataProject)
return o
}
// SetMetadataProject adds the metadataProject to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) SetMetadataProject(metadataProject *string) {
o.MetadataProject = metadataProject
}
// WithSpecAutoApprove adds the specAutoApprove to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) WithSpecAutoApprove(specAutoApprove *bool) *BootstrapGetBootstrapAgentTemplateParams {
o.SetSpecAutoApprove(specAutoApprove)
return o
}
// SetSpecAutoApprove adds the specAutoApprove to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) SetSpecAutoApprove(specAutoApprove *bool) {
o.SpecAutoApprove = specAutoApprove
}
// WithSpecAutoRegister adds the specAutoRegister to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) WithSpecAutoRegister(specAutoRegister *bool) *BootstrapGetBootstrapAgentTemplateParams {
o.SetSpecAutoRegister(specAutoRegister)
return o
}
// SetSpecAutoRegister adds the specAutoRegister to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) SetSpecAutoRegister(specAutoRegister *bool) {
o.SpecAutoRegister = specAutoRegister
}
// WithSpecIgnoreMultipleRegister adds the specIgnoreMultipleRegister to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) WithSpecIgnoreMultipleRegister(specIgnoreMultipleRegister *bool) *BootstrapGetBootstrapAgentTemplateParams {
o.SetSpecIgnoreMultipleRegister(specIgnoreMultipleRegister)
return o
}
// SetSpecIgnoreMultipleRegister adds the specIgnoreMultipleRegister to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) SetSpecIgnoreMultipleRegister(specIgnoreMultipleRegister *bool) {
o.SpecIgnoreMultipleRegister = specIgnoreMultipleRegister
}
// WithSpecInClusterTemplate adds the specInClusterTemplate to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) WithSpecInClusterTemplate(specInClusterTemplate *string) *BootstrapGetBootstrapAgentTemplateParams {
o.SetSpecInClusterTemplate(specInClusterTemplate)
return o
}
// SetSpecInClusterTemplate adds the specInClusterTemplate to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) SetSpecInClusterTemplate(specInClusterTemplate *string) {
o.SpecInClusterTemplate = specInClusterTemplate
}
// WithSpecInfraRef adds the specInfraRef to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) WithSpecInfraRef(specInfraRef *string) *BootstrapGetBootstrapAgentTemplateParams {
o.SetSpecInfraRef(specInfraRef)
return o
}
// SetSpecInfraRef adds the specInfraRef to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) SetSpecInfraRef(specInfraRef *string) {
o.SpecInfraRef = specInfraRef
}
// WithSpecOutOfClusterTemplate adds the specOutOfClusterTemplate to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) WithSpecOutOfClusterTemplate(specOutOfClusterTemplate *string) *BootstrapGetBootstrapAgentTemplateParams {
o.SetSpecOutOfClusterTemplate(specOutOfClusterTemplate)
return o
}
// SetSpecOutOfClusterTemplate adds the specOutOfClusterTemplate to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) SetSpecOutOfClusterTemplate(specOutOfClusterTemplate *string) {
o.SpecOutOfClusterTemplate = specOutOfClusterTemplate
}
// WithSpecTemplateType adds the specTemplateType to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) WithSpecTemplateType(specTemplateType *string) *BootstrapGetBootstrapAgentTemplateParams {
o.SetSpecTemplateType(specTemplateType)
return o
}
// SetSpecTemplateType adds the specTemplateType to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) SetSpecTemplateType(specTemplateType *string) {
o.SpecTemplateType = specTemplateType
}
// WithSpecToken adds the specToken to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) WithSpecToken(specToken *string) *BootstrapGetBootstrapAgentTemplateParams {
o.SetSpecToken(specToken)
return o
}
// SetSpecToken adds the specToken to the bootstrap get bootstrap agent template params
func (o *BootstrapGetBootstrapAgentTemplateParams) SetSpecToken(specToken *string) {
o.SpecToken = specToken
}
// WriteToRequest writes these params to a swagger request
func (o *BootstrapGetBootstrapAgentTemplateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.APIVersion != nil {
// query param apiVersion
var qrAPIVersion string
if o.APIVersion != nil {
qrAPIVersion = *o.APIVersion
}
qAPIVersion := qrAPIVersion
if qAPIVersion != "" {
if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil {
return err
}
}
}
if o.Kind != nil {
// query param kind
var qrKind string
if o.Kind != nil {
qrKind = *o.Kind
}
qKind := qrKind
if qKind != "" {
if err := r.SetQueryParam("kind", qKind); err != nil {
return err
}
}
}
if o.MetadataDescription != nil {
// query param metadata.description
var qrMetadataDescription string
if o.MetadataDescription != nil {
qrMetadataDescription = *o.MetadataDescription
}
qMetadataDescription := qrMetadataDescription
if qMetadataDescription != "" {
if err := r.SetQueryParam("metadata.description", qMetadataDescription); err != nil {
return err
}
}
}
if o.MetadataDisplayName != nil {
// query param metadata.displayName
var qrMetadataDisplayName string
if o.MetadataDisplayName != nil {
qrMetadataDisplayName = *o.MetadataDisplayName
}
qMetadataDisplayName := qrMetadataDisplayName
if qMetadataDisplayName != "" {
if err := r.SetQueryParam("metadata.displayName", qMetadataDisplayName); err != nil {
return err
}
}
}
if o.MetadataID != nil {
// query param metadata.id
var qrMetadataID string
if o.MetadataID != nil {
qrMetadataID = *o.MetadataID
}
qMetadataID := qrMetadataID
if qMetadataID != "" {
if err := r.SetQueryParam("metadata.id", qMetadataID); err != nil {
return err
}
}
}
if o.MetadataModifiedAt != nil {
// query param metadata.modifiedAt
var qrMetadataModifiedAt strfmt.DateTime
if o.MetadataModifiedAt != nil {
qrMetadataModifiedAt = *o.MetadataModifiedAt
}
qMetadataModifiedAt := qrMetadataModifiedAt.String()
if qMetadataModifiedAt != "" {
if err := r.SetQueryParam("metadata.modifiedAt", qMetadataModifiedAt); err != nil {
return err
}
}
}
// path param metadata.name
if err := r.SetPathParam("metadata.name", o.MetadataName); err != nil {
return err
}
if o.MetadataOrganization != nil {
// query param metadata.organization
var qrMetadataOrganization string
if o.MetadataOrganization != nil {
qrMetadataOrganization = *o.MetadataOrganization
}
qMetadataOrganization := qrMetadataOrganization
if qMetadataOrganization != "" {
if err := r.SetQueryParam("metadata.organization", qMetadataOrganization); err != nil {
return err
}
}
}
if o.MetadataPartner != nil {
// query param metadata.partner
var qrMetadataPartner string
if o.MetadataPartner != nil {
qrMetadataPartner = *o.MetadataPartner
}
qMetadataPartner := qrMetadataPartner
if qMetadataPartner != "" {
if err := r.SetQueryParam("metadata.partner", qMetadataPartner); err != nil {
return err
}
}
}
if o.MetadataProject != nil {
// query param metadata.project
var qrMetadataProject string
if o.MetadataProject != nil {
qrMetadataProject = *o.MetadataProject
}
qMetadataProject := qrMetadataProject
if qMetadataProject != "" {
if err := r.SetQueryParam("metadata.project", qMetadataProject); err != nil {
return err
}
}
}
if o.SpecAutoApprove != nil {
// query param spec.autoApprove
var qrSpecAutoApprove bool
if o.SpecAutoApprove != nil {
qrSpecAutoApprove = *o.SpecAutoApprove
}
qSpecAutoApprove := swag.FormatBool(qrSpecAutoApprove)
if qSpecAutoApprove != "" {
if err := r.SetQueryParam("spec.autoApprove", qSpecAutoApprove); err != nil {
return err
}
}
}
if o.SpecAutoRegister != nil {
// query param spec.autoRegister
var qrSpecAutoRegister bool
if o.SpecAutoRegister != nil {
qrSpecAutoRegister = *o.SpecAutoRegister
}
qSpecAutoRegister := swag.FormatBool(qrSpecAutoRegister)
if qSpecAutoRegister != "" {
if err := r.SetQueryParam("spec.autoRegister", qSpecAutoRegister); err != nil {
return err
}
}
}
if o.SpecIgnoreMultipleRegister != nil {
// query param spec.ignoreMultipleRegister
var qrSpecIgnoreMultipleRegister bool
if o.SpecIgnoreMultipleRegister != nil {
qrSpecIgnoreMultipleRegister = *o.SpecIgnoreMultipleRegister
}
qSpecIgnoreMultipleRegister := swag.FormatBool(qrSpecIgnoreMultipleRegister)
if qSpecIgnoreMultipleRegister != "" {
if err := r.SetQueryParam("spec.ignoreMultipleRegister", qSpecIgnoreMultipleRegister); err != nil {
return err
}
}
}
if o.SpecInClusterTemplate != nil {
// query param spec.inClusterTemplate
var qrSpecInClusterTemplate string
if o.SpecInClusterTemplate != nil {
qrSpecInClusterTemplate = *o.SpecInClusterTemplate
}
qSpecInClusterTemplate := qrSpecInClusterTemplate
if qSpecInClusterTemplate != "" {
if err := r.SetQueryParam("spec.inClusterTemplate", qSpecInClusterTemplate); err != nil {
return err
}
}
}
if o.SpecInfraRef != nil {
// query param spec.infraRef
var qrSpecInfraRef string
if o.SpecInfraRef != nil {
qrSpecInfraRef = *o.SpecInfraRef
}
qSpecInfraRef := qrSpecInfraRef
if qSpecInfraRef != "" {
if err := r.SetQueryParam("spec.infraRef", qSpecInfraRef); err != nil {
return err
}
}
}
if o.SpecOutOfClusterTemplate != nil {
// query param spec.outOfClusterTemplate
var qrSpecOutOfClusterTemplate string
if o.SpecOutOfClusterTemplate != nil {
qrSpecOutOfClusterTemplate = *o.SpecOutOfClusterTemplate
}
qSpecOutOfClusterTemplate := qrSpecOutOfClusterTemplate
if qSpecOutOfClusterTemplate != "" {
if err := r.SetQueryParam("spec.outOfClusterTemplate", qSpecOutOfClusterTemplate); err != nil {
return err
}
}
}
if o.SpecTemplateType != nil {
// query param spec.templateType
var qrSpecTemplateType string
if o.SpecTemplateType != nil {
qrSpecTemplateType = *o.SpecTemplateType
}
qSpecTemplateType := qrSpecTemplateType
if qSpecTemplateType != "" {
if err := r.SetQueryParam("spec.templateType", qSpecTemplateType); err != nil {
return err
}
}
}
if o.SpecToken != nil {
// query param spec.token
var qrSpecToken string
if o.SpecToken != nil {
qrSpecToken = *o.SpecToken
}
qSpecToken := qrSpecToken
if qSpecToken != "" {
if err := r.SetQueryParam("spec.token", qSpecToken); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,223 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/models"
)
// BootstrapGetBootstrapAgentTemplateReader is a Reader for the BootstrapGetBootstrapAgentTemplate structure.
type BootstrapGetBootstrapAgentTemplateReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *BootstrapGetBootstrapAgentTemplateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewBootstrapGetBootstrapAgentTemplateOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewBootstrapGetBootstrapAgentTemplateForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewBootstrapGetBootstrapAgentTemplateNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewBootstrapGetBootstrapAgentTemplateInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewBootstrapGetBootstrapAgentTemplateDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewBootstrapGetBootstrapAgentTemplateOK creates a BootstrapGetBootstrapAgentTemplateOK with default headers values
func NewBootstrapGetBootstrapAgentTemplateOK() *BootstrapGetBootstrapAgentTemplateOK {
return &BootstrapGetBootstrapAgentTemplateOK{}
}
/* BootstrapGetBootstrapAgentTemplateOK describes a response with status code 200, with default header values.
A successful response.
*/
type BootstrapGetBootstrapAgentTemplateOK struct {
Payload *models.SentryBootstrapAgentTemplate
}
func (o *BootstrapGetBootstrapAgentTemplateOK) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/template/{metadata.name}][%d] bootstrapGetBootstrapAgentTemplateOK %+v", 200, o.Payload)
}
func (o *BootstrapGetBootstrapAgentTemplateOK) GetPayload() *models.SentryBootstrapAgentTemplate {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentTemplateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.SentryBootstrapAgentTemplate)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapAgentTemplateForbidden creates a BootstrapGetBootstrapAgentTemplateForbidden with default headers values
func NewBootstrapGetBootstrapAgentTemplateForbidden() *BootstrapGetBootstrapAgentTemplateForbidden {
return &BootstrapGetBootstrapAgentTemplateForbidden{}
}
/* BootstrapGetBootstrapAgentTemplateForbidden describes a response with status code 403, with default header values.
Returned when the user does not have permission to access the resource.
*/
type BootstrapGetBootstrapAgentTemplateForbidden struct {
Payload interface{}
}
func (o *BootstrapGetBootstrapAgentTemplateForbidden) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/template/{metadata.name}][%d] bootstrapGetBootstrapAgentTemplateForbidden %+v", 403, o.Payload)
}
func (o *BootstrapGetBootstrapAgentTemplateForbidden) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentTemplateForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapAgentTemplateNotFound creates a BootstrapGetBootstrapAgentTemplateNotFound with default headers values
func NewBootstrapGetBootstrapAgentTemplateNotFound() *BootstrapGetBootstrapAgentTemplateNotFound {
return &BootstrapGetBootstrapAgentTemplateNotFound{}
}
/* BootstrapGetBootstrapAgentTemplateNotFound describes a response with status code 404, with default header values.
Returned when the resource does not exist.
*/
type BootstrapGetBootstrapAgentTemplateNotFound struct {
Payload interface{}
}
func (o *BootstrapGetBootstrapAgentTemplateNotFound) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/template/{metadata.name}][%d] bootstrapGetBootstrapAgentTemplateNotFound %+v", 404, o.Payload)
}
func (o *BootstrapGetBootstrapAgentTemplateNotFound) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentTemplateNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapAgentTemplateInternalServerError creates a BootstrapGetBootstrapAgentTemplateInternalServerError with default headers values
func NewBootstrapGetBootstrapAgentTemplateInternalServerError() *BootstrapGetBootstrapAgentTemplateInternalServerError {
return &BootstrapGetBootstrapAgentTemplateInternalServerError{}
}
/* BootstrapGetBootstrapAgentTemplateInternalServerError describes a response with status code 500, with default header values.
Returned for internal server error
*/
type BootstrapGetBootstrapAgentTemplateInternalServerError struct {
Payload interface{}
}
func (o *BootstrapGetBootstrapAgentTemplateInternalServerError) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/template/{metadata.name}][%d] bootstrapGetBootstrapAgentTemplateInternalServerError %+v", 500, o.Payload)
}
func (o *BootstrapGetBootstrapAgentTemplateInternalServerError) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentTemplateInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapAgentTemplateDefault creates a BootstrapGetBootstrapAgentTemplateDefault with default headers values
func NewBootstrapGetBootstrapAgentTemplateDefault(code int) *BootstrapGetBootstrapAgentTemplateDefault {
return &BootstrapGetBootstrapAgentTemplateDefault{
_statusCode: code,
}
}
/* BootstrapGetBootstrapAgentTemplateDefault describes a response with status code -1, with default header values.
An unexpected error response.
*/
type BootstrapGetBootstrapAgentTemplateDefault struct {
_statusCode int
Payload *models.GooglerpcStatus
}
// Code gets the status code for the bootstrap get bootstrap agent template default response
func (o *BootstrapGetBootstrapAgentTemplateDefault) Code() int {
return o._statusCode
}
func (o *BootstrapGetBootstrapAgentTemplateDefault) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/template/{metadata.name}][%d] Bootstrap_GetBootstrapAgentTemplate default %+v", o._statusCode, o.Payload)
}
func (o *BootstrapGetBootstrapAgentTemplateDefault) GetPayload() *models.GooglerpcStatus {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentTemplateDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.GooglerpcStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@@ -0,0 +1,909 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// NewBootstrapGetBootstrapAgentTemplatesParams creates a new BootstrapGetBootstrapAgentTemplatesParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewBootstrapGetBootstrapAgentTemplatesParams() *BootstrapGetBootstrapAgentTemplatesParams {
return &BootstrapGetBootstrapAgentTemplatesParams{
timeout: cr.DefaultTimeout,
}
}
// NewBootstrapGetBootstrapAgentTemplatesParamsWithTimeout creates a new BootstrapGetBootstrapAgentTemplatesParams object
// with the ability to set a timeout on a request.
func NewBootstrapGetBootstrapAgentTemplatesParamsWithTimeout(timeout time.Duration) *BootstrapGetBootstrapAgentTemplatesParams {
return &BootstrapGetBootstrapAgentTemplatesParams{
timeout: timeout,
}
}
// NewBootstrapGetBootstrapAgentTemplatesParamsWithContext creates a new BootstrapGetBootstrapAgentTemplatesParams object
// with the ability to set a context for a request.
func NewBootstrapGetBootstrapAgentTemplatesParamsWithContext(ctx context.Context) *BootstrapGetBootstrapAgentTemplatesParams {
return &BootstrapGetBootstrapAgentTemplatesParams{
Context: ctx,
}
}
// NewBootstrapGetBootstrapAgentTemplatesParamsWithHTTPClient creates a new BootstrapGetBootstrapAgentTemplatesParams object
// with the ability to set a custom HTTPClient for a request.
func NewBootstrapGetBootstrapAgentTemplatesParamsWithHTTPClient(client *http.Client) *BootstrapGetBootstrapAgentTemplatesParams {
return &BootstrapGetBootstrapAgentTemplatesParams{
HTTPClient: client,
}
}
/* BootstrapGetBootstrapAgentTemplatesParams contains all the parameters to send to the API endpoint
for the bootstrap get bootstrap agent templates operation.
Typically these are written to a http.Request.
*/
type BootstrapGetBootstrapAgentTemplatesParams struct {
// ID.
ID *string
// Account.
Account *string
// BlueprintRef.
BlueprintRef *string
// ClusterID.
ClusterID *string
// Count.
//
// Format: int64
Count *string
// Deleted.
Deleted *bool
/* DisplayName.
displayName only used for update queries to set displayName (READONLY).
*/
DisplayName *string
// Extended.
Extended *bool
/* GlobalScope.
globalScope sets partnerID,organizationID,projectID = 0.
*/
GlobalScope *bool
// Groups.
Groups []string
/* IgnoreScopeDefault.
ignoreScopeDefault ignores default values for partnerID, organizationID and
projectID.
*/
IgnoreScopeDefault *bool
// IsSSOUser.
IsSSOUser *bool
// Limit.
//
// Format: int64
Limit *string
/* Name.
name is unique ID of a resource along with (partnerID, organizationID,
projectID).
*/
Name *string
// Offset.
//
// Format: int64
Offset *string
// Order.
Order *string
// OrderBy.
OrderBy *string
// Organization.
Organization *string
// Partner.
Partner *string
// Project.
Project *string
// PublishedVersion.
PublishedVersion *string
/* Selector.
selector is used to filter the labels of a resource.
*/
Selector *string
/* URLScope.
urlScope is supposed to be passed in the URL as kind/HashID(value).
*/
URLScope *string
// Username.
Username *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the bootstrap get bootstrap agent templates params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithDefaults() *BootstrapGetBootstrapAgentTemplatesParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the bootstrap get bootstrap agent templates params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithTimeout(timeout time.Duration) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithContext(ctx context.Context) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithHTTPClient(client *http.Client) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithID adds the id to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithID(id *string) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetID(id)
return o
}
// SetID adds the id to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetID(id *string) {
o.ID = id
}
// WithAccount adds the account to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithAccount(account *string) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetAccount(account)
return o
}
// SetAccount adds the account to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetAccount(account *string) {
o.Account = account
}
// WithBlueprintRef adds the blueprintRef to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithBlueprintRef(blueprintRef *string) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetBlueprintRef(blueprintRef)
return o
}
// SetBlueprintRef adds the blueprintRef to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetBlueprintRef(blueprintRef *string) {
o.BlueprintRef = blueprintRef
}
// WithClusterID adds the clusterID to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithClusterID(clusterID *string) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetClusterID(clusterID)
return o
}
// SetClusterID adds the clusterId to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetClusterID(clusterID *string) {
o.ClusterID = clusterID
}
// WithCount adds the count to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithCount(count *string) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetCount(count)
return o
}
// SetCount adds the count to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetCount(count *string) {
o.Count = count
}
// WithDeleted adds the deleted to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithDeleted(deleted *bool) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetDeleted(deleted)
return o
}
// SetDeleted adds the deleted to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetDeleted(deleted *bool) {
o.Deleted = deleted
}
// WithDisplayName adds the displayName to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithDisplayName(displayName *string) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetDisplayName(displayName)
return o
}
// SetDisplayName adds the displayName to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetDisplayName(displayName *string) {
o.DisplayName = displayName
}
// WithExtended adds the extended to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithExtended(extended *bool) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetExtended(extended)
return o
}
// SetExtended adds the extended to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetExtended(extended *bool) {
o.Extended = extended
}
// WithGlobalScope adds the globalScope to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithGlobalScope(globalScope *bool) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetGlobalScope(globalScope)
return o
}
// SetGlobalScope adds the globalScope to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetGlobalScope(globalScope *bool) {
o.GlobalScope = globalScope
}
// WithGroups adds the groups to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithGroups(groups []string) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetGroups(groups)
return o
}
// SetGroups adds the groups to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetGroups(groups []string) {
o.Groups = groups
}
// WithIgnoreScopeDefault adds the ignoreScopeDefault to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithIgnoreScopeDefault(ignoreScopeDefault *bool) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetIgnoreScopeDefault(ignoreScopeDefault)
return o
}
// SetIgnoreScopeDefault adds the ignoreScopeDefault to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetIgnoreScopeDefault(ignoreScopeDefault *bool) {
o.IgnoreScopeDefault = ignoreScopeDefault
}
// WithIsSSOUser adds the isSSOUser to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithIsSSOUser(isSSOUser *bool) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetIsSSOUser(isSSOUser)
return o
}
// SetIsSSOUser adds the isSSOUser to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetIsSSOUser(isSSOUser *bool) {
o.IsSSOUser = isSSOUser
}
// WithLimit adds the limit to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithLimit(limit *string) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetLimit(limit *string) {
o.Limit = limit
}
// WithName adds the name to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithName(name *string) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetName(name)
return o
}
// SetName adds the name to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetName(name *string) {
o.Name = name
}
// WithOffset adds the offset to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithOffset(offset *string) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetOffset(offset)
return o
}
// SetOffset adds the offset to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetOffset(offset *string) {
o.Offset = offset
}
// WithOrder adds the order to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithOrder(order *string) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetOrder(order)
return o
}
// SetOrder adds the order to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetOrder(order *string) {
o.Order = order
}
// WithOrderBy adds the orderBy to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithOrderBy(orderBy *string) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetOrderBy(orderBy)
return o
}
// SetOrderBy adds the orderBy to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetOrderBy(orderBy *string) {
o.OrderBy = orderBy
}
// WithOrganization adds the organization to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithOrganization(organization *string) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetOrganization(organization)
return o
}
// SetOrganization adds the organization to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetOrganization(organization *string) {
o.Organization = organization
}
// WithPartner adds the partner to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithPartner(partner *string) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetPartner(partner)
return o
}
// SetPartner adds the partner to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetPartner(partner *string) {
o.Partner = partner
}
// WithProject adds the project to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithProject(project *string) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetProject(project)
return o
}
// SetProject adds the project to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetProject(project *string) {
o.Project = project
}
// WithPublishedVersion adds the publishedVersion to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithPublishedVersion(publishedVersion *string) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetPublishedVersion(publishedVersion)
return o
}
// SetPublishedVersion adds the publishedVersion to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetPublishedVersion(publishedVersion *string) {
o.PublishedVersion = publishedVersion
}
// WithSelector adds the selector to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithSelector(selector *string) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetSelector(selector)
return o
}
// SetSelector adds the selector to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetSelector(selector *string) {
o.Selector = selector
}
// WithURLScope adds the uRLScope to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithURLScope(uRLScope *string) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetURLScope(uRLScope)
return o
}
// SetURLScope adds the urlScope to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetURLScope(uRLScope *string) {
o.URLScope = uRLScope
}
// WithUsername adds the username to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) WithUsername(username *string) *BootstrapGetBootstrapAgentTemplatesParams {
o.SetUsername(username)
return o
}
// SetUsername adds the username to the bootstrap get bootstrap agent templates params
func (o *BootstrapGetBootstrapAgentTemplatesParams) SetUsername(username *string) {
o.Username = username
}
// WriteToRequest writes these params to a swagger request
func (o *BootstrapGetBootstrapAgentTemplatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.ID != nil {
// query param ID
var qrID string
if o.ID != nil {
qrID = *o.ID
}
qID := qrID
if qID != "" {
if err := r.SetQueryParam("ID", qID); err != nil {
return err
}
}
}
if o.Account != nil {
// query param account
var qrAccount string
if o.Account != nil {
qrAccount = *o.Account
}
qAccount := qrAccount
if qAccount != "" {
if err := r.SetQueryParam("account", qAccount); err != nil {
return err
}
}
}
if o.BlueprintRef != nil {
// query param blueprintRef
var qrBlueprintRef string
if o.BlueprintRef != nil {
qrBlueprintRef = *o.BlueprintRef
}
qBlueprintRef := qrBlueprintRef
if qBlueprintRef != "" {
if err := r.SetQueryParam("blueprintRef", qBlueprintRef); err != nil {
return err
}
}
}
if o.ClusterID != nil {
// query param clusterID
var qrClusterID string
if o.ClusterID != nil {
qrClusterID = *o.ClusterID
}
qClusterID := qrClusterID
if qClusterID != "" {
if err := r.SetQueryParam("clusterID", qClusterID); err != nil {
return err
}
}
}
if o.Count != nil {
// query param count
var qrCount string
if o.Count != nil {
qrCount = *o.Count
}
qCount := qrCount
if qCount != "" {
if err := r.SetQueryParam("count", qCount); err != nil {
return err
}
}
}
if o.Deleted != nil {
// query param deleted
var qrDeleted bool
if o.Deleted != nil {
qrDeleted = *o.Deleted
}
qDeleted := swag.FormatBool(qrDeleted)
if qDeleted != "" {
if err := r.SetQueryParam("deleted", qDeleted); err != nil {
return err
}
}
}
if o.DisplayName != nil {
// query param displayName
var qrDisplayName string
if o.DisplayName != nil {
qrDisplayName = *o.DisplayName
}
qDisplayName := qrDisplayName
if qDisplayName != "" {
if err := r.SetQueryParam("displayName", qDisplayName); err != nil {
return err
}
}
}
if o.Extended != nil {
// query param extended
var qrExtended bool
if o.Extended != nil {
qrExtended = *o.Extended
}
qExtended := swag.FormatBool(qrExtended)
if qExtended != "" {
if err := r.SetQueryParam("extended", qExtended); err != nil {
return err
}
}
}
if o.GlobalScope != nil {
// query param globalScope
var qrGlobalScope bool
if o.GlobalScope != nil {
qrGlobalScope = *o.GlobalScope
}
qGlobalScope := swag.FormatBool(qrGlobalScope)
if qGlobalScope != "" {
if err := r.SetQueryParam("globalScope", qGlobalScope); err != nil {
return err
}
}
}
if o.Groups != nil {
// binding items for groups
joinedGroups := o.bindParamGroups(reg)
// query array param groups
if err := r.SetQueryParam("groups", joinedGroups...); err != nil {
return err
}
}
if o.IgnoreScopeDefault != nil {
// query param ignoreScopeDefault
var qrIgnoreScopeDefault bool
if o.IgnoreScopeDefault != nil {
qrIgnoreScopeDefault = *o.IgnoreScopeDefault
}
qIgnoreScopeDefault := swag.FormatBool(qrIgnoreScopeDefault)
if qIgnoreScopeDefault != "" {
if err := r.SetQueryParam("ignoreScopeDefault", qIgnoreScopeDefault); err != nil {
return err
}
}
}
if o.IsSSOUser != nil {
// query param isSSOUser
var qrIsSSOUser bool
if o.IsSSOUser != nil {
qrIsSSOUser = *o.IsSSOUser
}
qIsSSOUser := swag.FormatBool(qrIsSSOUser)
if qIsSSOUser != "" {
if err := r.SetQueryParam("isSSOUser", qIsSSOUser); err != nil {
return err
}
}
}
if o.Limit != nil {
// query param limit
var qrLimit string
if o.Limit != nil {
qrLimit = *o.Limit
}
qLimit := qrLimit
if qLimit != "" {
if err := r.SetQueryParam("limit", qLimit); err != nil {
return err
}
}
}
if o.Name != nil {
// query param name
var qrName string
if o.Name != nil {
qrName = *o.Name
}
qName := qrName
if qName != "" {
if err := r.SetQueryParam("name", qName); err != nil {
return err
}
}
}
if o.Offset != nil {
// query param offset
var qrOffset string
if o.Offset != nil {
qrOffset = *o.Offset
}
qOffset := qrOffset
if qOffset != "" {
if err := r.SetQueryParam("offset", qOffset); err != nil {
return err
}
}
}
if o.Order != nil {
// query param order
var qrOrder string
if o.Order != nil {
qrOrder = *o.Order
}
qOrder := qrOrder
if qOrder != "" {
if err := r.SetQueryParam("order", qOrder); err != nil {
return err
}
}
}
if o.OrderBy != nil {
// query param orderBy
var qrOrderBy string
if o.OrderBy != nil {
qrOrderBy = *o.OrderBy
}
qOrderBy := qrOrderBy
if qOrderBy != "" {
if err := r.SetQueryParam("orderBy", qOrderBy); err != nil {
return err
}
}
}
if o.Organization != nil {
// query param organization
var qrOrganization string
if o.Organization != nil {
qrOrganization = *o.Organization
}
qOrganization := qrOrganization
if qOrganization != "" {
if err := r.SetQueryParam("organization", qOrganization); err != nil {
return err
}
}
}
if o.Partner != nil {
// query param partner
var qrPartner string
if o.Partner != nil {
qrPartner = *o.Partner
}
qPartner := qrPartner
if qPartner != "" {
if err := r.SetQueryParam("partner", qPartner); err != nil {
return err
}
}
}
if o.Project != nil {
// query param project
var qrProject string
if o.Project != nil {
qrProject = *o.Project
}
qProject := qrProject
if qProject != "" {
if err := r.SetQueryParam("project", qProject); err != nil {
return err
}
}
}
if o.PublishedVersion != nil {
// query param publishedVersion
var qrPublishedVersion string
if o.PublishedVersion != nil {
qrPublishedVersion = *o.PublishedVersion
}
qPublishedVersion := qrPublishedVersion
if qPublishedVersion != "" {
if err := r.SetQueryParam("publishedVersion", qPublishedVersion); err != nil {
return err
}
}
}
if o.Selector != nil {
// query param selector
var qrSelector string
if o.Selector != nil {
qrSelector = *o.Selector
}
qSelector := qrSelector
if qSelector != "" {
if err := r.SetQueryParam("selector", qSelector); err != nil {
return err
}
}
}
if o.URLScope != nil {
// query param urlScope
var qrURLScope string
if o.URLScope != nil {
qrURLScope = *o.URLScope
}
qURLScope := qrURLScope
if qURLScope != "" {
if err := r.SetQueryParam("urlScope", qURLScope); err != nil {
return err
}
}
}
if o.Username != nil {
// query param username
var qrUsername string
if o.Username != nil {
qrUsername = *o.Username
}
qUsername := qrUsername
if qUsername != "" {
if err := r.SetQueryParam("username", qUsername); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// bindParamBootstrapGetBootstrapAgentTemplates binds the parameter groups
func (o *BootstrapGetBootstrapAgentTemplatesParams) bindParamGroups(formats strfmt.Registry) []string {
groupsIR := o.Groups
var groupsIC []string
for _, groupsIIR := range groupsIR { // explode []string
groupsIIV := groupsIIR // string as string
groupsIC = append(groupsIC, groupsIIV)
}
// items.CollectionFormat: "multi"
groupsIS := swag.JoinByFormat(groupsIC, "multi")
return groupsIS
}

View File

@@ -0,0 +1,223 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/models"
)
// BootstrapGetBootstrapAgentTemplatesReader is a Reader for the BootstrapGetBootstrapAgentTemplates structure.
type BootstrapGetBootstrapAgentTemplatesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *BootstrapGetBootstrapAgentTemplatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewBootstrapGetBootstrapAgentTemplatesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewBootstrapGetBootstrapAgentTemplatesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewBootstrapGetBootstrapAgentTemplatesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewBootstrapGetBootstrapAgentTemplatesInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewBootstrapGetBootstrapAgentTemplatesDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewBootstrapGetBootstrapAgentTemplatesOK creates a BootstrapGetBootstrapAgentTemplatesOK with default headers values
func NewBootstrapGetBootstrapAgentTemplatesOK() *BootstrapGetBootstrapAgentTemplatesOK {
return &BootstrapGetBootstrapAgentTemplatesOK{}
}
/* BootstrapGetBootstrapAgentTemplatesOK describes a response with status code 200, with default header values.
A successful response.
*/
type BootstrapGetBootstrapAgentTemplatesOK struct {
Payload *models.SentryBootstrapAgentTemplateList
}
func (o *BootstrapGetBootstrapAgentTemplatesOK) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/template][%d] bootstrapGetBootstrapAgentTemplatesOK %+v", 200, o.Payload)
}
func (o *BootstrapGetBootstrapAgentTemplatesOK) GetPayload() *models.SentryBootstrapAgentTemplateList {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentTemplatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.SentryBootstrapAgentTemplateList)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapAgentTemplatesForbidden creates a BootstrapGetBootstrapAgentTemplatesForbidden with default headers values
func NewBootstrapGetBootstrapAgentTemplatesForbidden() *BootstrapGetBootstrapAgentTemplatesForbidden {
return &BootstrapGetBootstrapAgentTemplatesForbidden{}
}
/* BootstrapGetBootstrapAgentTemplatesForbidden describes a response with status code 403, with default header values.
Returned when the user does not have permission to access the resource.
*/
type BootstrapGetBootstrapAgentTemplatesForbidden struct {
Payload interface{}
}
func (o *BootstrapGetBootstrapAgentTemplatesForbidden) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/template][%d] bootstrapGetBootstrapAgentTemplatesForbidden %+v", 403, o.Payload)
}
func (o *BootstrapGetBootstrapAgentTemplatesForbidden) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentTemplatesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapAgentTemplatesNotFound creates a BootstrapGetBootstrapAgentTemplatesNotFound with default headers values
func NewBootstrapGetBootstrapAgentTemplatesNotFound() *BootstrapGetBootstrapAgentTemplatesNotFound {
return &BootstrapGetBootstrapAgentTemplatesNotFound{}
}
/* BootstrapGetBootstrapAgentTemplatesNotFound describes a response with status code 404, with default header values.
Returned when the resource does not exist.
*/
type BootstrapGetBootstrapAgentTemplatesNotFound struct {
Payload interface{}
}
func (o *BootstrapGetBootstrapAgentTemplatesNotFound) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/template][%d] bootstrapGetBootstrapAgentTemplatesNotFound %+v", 404, o.Payload)
}
func (o *BootstrapGetBootstrapAgentTemplatesNotFound) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentTemplatesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapAgentTemplatesInternalServerError creates a BootstrapGetBootstrapAgentTemplatesInternalServerError with default headers values
func NewBootstrapGetBootstrapAgentTemplatesInternalServerError() *BootstrapGetBootstrapAgentTemplatesInternalServerError {
return &BootstrapGetBootstrapAgentTemplatesInternalServerError{}
}
/* BootstrapGetBootstrapAgentTemplatesInternalServerError describes a response with status code 500, with default header values.
Returned for internal server error
*/
type BootstrapGetBootstrapAgentTemplatesInternalServerError struct {
Payload interface{}
}
func (o *BootstrapGetBootstrapAgentTemplatesInternalServerError) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/template][%d] bootstrapGetBootstrapAgentTemplatesInternalServerError %+v", 500, o.Payload)
}
func (o *BootstrapGetBootstrapAgentTemplatesInternalServerError) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentTemplatesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapAgentTemplatesDefault creates a BootstrapGetBootstrapAgentTemplatesDefault with default headers values
func NewBootstrapGetBootstrapAgentTemplatesDefault(code int) *BootstrapGetBootstrapAgentTemplatesDefault {
return &BootstrapGetBootstrapAgentTemplatesDefault{
_statusCode: code,
}
}
/* BootstrapGetBootstrapAgentTemplatesDefault describes a response with status code -1, with default header values.
An unexpected error response.
*/
type BootstrapGetBootstrapAgentTemplatesDefault struct {
_statusCode int
Payload *models.GooglerpcStatus
}
// Code gets the status code for the bootstrap get bootstrap agent templates default response
func (o *BootstrapGetBootstrapAgentTemplatesDefault) Code() int {
return o._statusCode
}
func (o *BootstrapGetBootstrapAgentTemplatesDefault) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/template][%d] Bootstrap_GetBootstrapAgentTemplates default %+v", o._statusCode, o.Payload)
}
func (o *BootstrapGetBootstrapAgentTemplatesDefault) GetPayload() *models.GooglerpcStatus {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentTemplatesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.GooglerpcStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@@ -0,0 +1,928 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// NewBootstrapGetBootstrapAgentsParams creates a new BootstrapGetBootstrapAgentsParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewBootstrapGetBootstrapAgentsParams() *BootstrapGetBootstrapAgentsParams {
return &BootstrapGetBootstrapAgentsParams{
timeout: cr.DefaultTimeout,
}
}
// NewBootstrapGetBootstrapAgentsParamsWithTimeout creates a new BootstrapGetBootstrapAgentsParams object
// with the ability to set a timeout on a request.
func NewBootstrapGetBootstrapAgentsParamsWithTimeout(timeout time.Duration) *BootstrapGetBootstrapAgentsParams {
return &BootstrapGetBootstrapAgentsParams{
timeout: timeout,
}
}
// NewBootstrapGetBootstrapAgentsParamsWithContext creates a new BootstrapGetBootstrapAgentsParams object
// with the ability to set a context for a request.
func NewBootstrapGetBootstrapAgentsParamsWithContext(ctx context.Context) *BootstrapGetBootstrapAgentsParams {
return &BootstrapGetBootstrapAgentsParams{
Context: ctx,
}
}
// NewBootstrapGetBootstrapAgentsParamsWithHTTPClient creates a new BootstrapGetBootstrapAgentsParams object
// with the ability to set a custom HTTPClient for a request.
func NewBootstrapGetBootstrapAgentsParamsWithHTTPClient(client *http.Client) *BootstrapGetBootstrapAgentsParams {
return &BootstrapGetBootstrapAgentsParams{
HTTPClient: client,
}
}
/* BootstrapGetBootstrapAgentsParams contains all the parameters to send to the API endpoint
for the bootstrap get bootstrap agents operation.
Typically these are written to a http.Request.
*/
type BootstrapGetBootstrapAgentsParams struct {
// OptsID.
OptsID *string
// OptsAccount.
OptsAccount *string
// OptsBlueprintRef.
OptsBlueprintRef *string
// OptsClusterID.
OptsClusterID *string
// OptsCount.
//
// Format: int64
OptsCount *string
// OptsDeleted.
OptsDeleted *bool
/* OptsDisplayName.
displayName only used for update queries to set displayName (READONLY).
*/
OptsDisplayName *string
// OptsExtended.
OptsExtended *bool
/* OptsGlobalScope.
globalScope sets partnerID,organizationID,projectID = 0.
*/
OptsGlobalScope *bool
// OptsGroups.
OptsGroups []string
/* OptsIgnoreScopeDefault.
ignoreScopeDefault ignores default values for partnerID, organizationID and
projectID.
*/
OptsIgnoreScopeDefault *bool
// OptsIsSSOUser.
OptsIsSSOUser *bool
// OptsLimit.
//
// Format: int64
OptsLimit *string
/* OptsName.
name is unique ID of a resource along with (partnerID, organizationID,
projectID).
*/
OptsName *string
// OptsOffset.
//
// Format: int64
OptsOffset *string
// OptsOrder.
OptsOrder *string
// OptsOrderBy.
OptsOrderBy *string
// OptsOrganization.
OptsOrganization *string
// OptsPartner.
OptsPartner *string
// OptsProject.
OptsProject *string
// OptsPublishedVersion.
OptsPublishedVersion *string
/* OptsSelector.
selector is used to filter the labels of a resource.
*/
OptsSelector *string
/* OptsURLScope.
urlScope is supposed to be passed in the URL as kind/HashID(value).
*/
OptsURLScope *string
// OptsUsername.
OptsUsername *string
// TemplateScope.
TemplateScope string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the bootstrap get bootstrap agents params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapGetBootstrapAgentsParams) WithDefaults() *BootstrapGetBootstrapAgentsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the bootstrap get bootstrap agents params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapGetBootstrapAgentsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithTimeout(timeout time.Duration) *BootstrapGetBootstrapAgentsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithContext(ctx context.Context) *BootstrapGetBootstrapAgentsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithHTTPClient(client *http.Client) *BootstrapGetBootstrapAgentsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithOptsID adds the optsID to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsID(optsID *string) *BootstrapGetBootstrapAgentsParams {
o.SetOptsID(optsID)
return o
}
// SetOptsID adds the optsId to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsID(optsID *string) {
o.OptsID = optsID
}
// WithOptsAccount adds the optsAccount to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsAccount(optsAccount *string) *BootstrapGetBootstrapAgentsParams {
o.SetOptsAccount(optsAccount)
return o
}
// SetOptsAccount adds the optsAccount to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsAccount(optsAccount *string) {
o.OptsAccount = optsAccount
}
// WithOptsBlueprintRef adds the optsBlueprintRef to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsBlueprintRef(optsBlueprintRef *string) *BootstrapGetBootstrapAgentsParams {
o.SetOptsBlueprintRef(optsBlueprintRef)
return o
}
// SetOptsBlueprintRef adds the optsBlueprintRef to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsBlueprintRef(optsBlueprintRef *string) {
o.OptsBlueprintRef = optsBlueprintRef
}
// WithOptsClusterID adds the optsClusterID to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsClusterID(optsClusterID *string) *BootstrapGetBootstrapAgentsParams {
o.SetOptsClusterID(optsClusterID)
return o
}
// SetOptsClusterID adds the optsClusterId to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsClusterID(optsClusterID *string) {
o.OptsClusterID = optsClusterID
}
// WithOptsCount adds the optsCount to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsCount(optsCount *string) *BootstrapGetBootstrapAgentsParams {
o.SetOptsCount(optsCount)
return o
}
// SetOptsCount adds the optsCount to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsCount(optsCount *string) {
o.OptsCount = optsCount
}
// WithOptsDeleted adds the optsDeleted to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsDeleted(optsDeleted *bool) *BootstrapGetBootstrapAgentsParams {
o.SetOptsDeleted(optsDeleted)
return o
}
// SetOptsDeleted adds the optsDeleted to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsDeleted(optsDeleted *bool) {
o.OptsDeleted = optsDeleted
}
// WithOptsDisplayName adds the optsDisplayName to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsDisplayName(optsDisplayName *string) *BootstrapGetBootstrapAgentsParams {
o.SetOptsDisplayName(optsDisplayName)
return o
}
// SetOptsDisplayName adds the optsDisplayName to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsDisplayName(optsDisplayName *string) {
o.OptsDisplayName = optsDisplayName
}
// WithOptsExtended adds the optsExtended to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsExtended(optsExtended *bool) *BootstrapGetBootstrapAgentsParams {
o.SetOptsExtended(optsExtended)
return o
}
// SetOptsExtended adds the optsExtended to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsExtended(optsExtended *bool) {
o.OptsExtended = optsExtended
}
// WithOptsGlobalScope adds the optsGlobalScope to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsGlobalScope(optsGlobalScope *bool) *BootstrapGetBootstrapAgentsParams {
o.SetOptsGlobalScope(optsGlobalScope)
return o
}
// SetOptsGlobalScope adds the optsGlobalScope to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsGlobalScope(optsGlobalScope *bool) {
o.OptsGlobalScope = optsGlobalScope
}
// WithOptsGroups adds the optsGroups to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsGroups(optsGroups []string) *BootstrapGetBootstrapAgentsParams {
o.SetOptsGroups(optsGroups)
return o
}
// SetOptsGroups adds the optsGroups to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsGroups(optsGroups []string) {
o.OptsGroups = optsGroups
}
// WithOptsIgnoreScopeDefault adds the optsIgnoreScopeDefault to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsIgnoreScopeDefault(optsIgnoreScopeDefault *bool) *BootstrapGetBootstrapAgentsParams {
o.SetOptsIgnoreScopeDefault(optsIgnoreScopeDefault)
return o
}
// SetOptsIgnoreScopeDefault adds the optsIgnoreScopeDefault to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsIgnoreScopeDefault(optsIgnoreScopeDefault *bool) {
o.OptsIgnoreScopeDefault = optsIgnoreScopeDefault
}
// WithOptsIsSSOUser adds the optsIsSSOUser to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsIsSSOUser(optsIsSSOUser *bool) *BootstrapGetBootstrapAgentsParams {
o.SetOptsIsSSOUser(optsIsSSOUser)
return o
}
// SetOptsIsSSOUser adds the optsIsSSOUser to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsIsSSOUser(optsIsSSOUser *bool) {
o.OptsIsSSOUser = optsIsSSOUser
}
// WithOptsLimit adds the optsLimit to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsLimit(optsLimit *string) *BootstrapGetBootstrapAgentsParams {
o.SetOptsLimit(optsLimit)
return o
}
// SetOptsLimit adds the optsLimit to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsLimit(optsLimit *string) {
o.OptsLimit = optsLimit
}
// WithOptsName adds the optsName to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsName(optsName *string) *BootstrapGetBootstrapAgentsParams {
o.SetOptsName(optsName)
return o
}
// SetOptsName adds the optsName to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsName(optsName *string) {
o.OptsName = optsName
}
// WithOptsOffset adds the optsOffset to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsOffset(optsOffset *string) *BootstrapGetBootstrapAgentsParams {
o.SetOptsOffset(optsOffset)
return o
}
// SetOptsOffset adds the optsOffset to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsOffset(optsOffset *string) {
o.OptsOffset = optsOffset
}
// WithOptsOrder adds the optsOrder to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsOrder(optsOrder *string) *BootstrapGetBootstrapAgentsParams {
o.SetOptsOrder(optsOrder)
return o
}
// SetOptsOrder adds the optsOrder to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsOrder(optsOrder *string) {
o.OptsOrder = optsOrder
}
// WithOptsOrderBy adds the optsOrderBy to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsOrderBy(optsOrderBy *string) *BootstrapGetBootstrapAgentsParams {
o.SetOptsOrderBy(optsOrderBy)
return o
}
// SetOptsOrderBy adds the optsOrderBy to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsOrderBy(optsOrderBy *string) {
o.OptsOrderBy = optsOrderBy
}
// WithOptsOrganization adds the optsOrganization to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsOrganization(optsOrganization *string) *BootstrapGetBootstrapAgentsParams {
o.SetOptsOrganization(optsOrganization)
return o
}
// SetOptsOrganization adds the optsOrganization to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsOrganization(optsOrganization *string) {
o.OptsOrganization = optsOrganization
}
// WithOptsPartner adds the optsPartner to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsPartner(optsPartner *string) *BootstrapGetBootstrapAgentsParams {
o.SetOptsPartner(optsPartner)
return o
}
// SetOptsPartner adds the optsPartner to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsPartner(optsPartner *string) {
o.OptsPartner = optsPartner
}
// WithOptsProject adds the optsProject to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsProject(optsProject *string) *BootstrapGetBootstrapAgentsParams {
o.SetOptsProject(optsProject)
return o
}
// SetOptsProject adds the optsProject to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsProject(optsProject *string) {
o.OptsProject = optsProject
}
// WithOptsPublishedVersion adds the optsPublishedVersion to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsPublishedVersion(optsPublishedVersion *string) *BootstrapGetBootstrapAgentsParams {
o.SetOptsPublishedVersion(optsPublishedVersion)
return o
}
// SetOptsPublishedVersion adds the optsPublishedVersion to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsPublishedVersion(optsPublishedVersion *string) {
o.OptsPublishedVersion = optsPublishedVersion
}
// WithOptsSelector adds the optsSelector to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsSelector(optsSelector *string) *BootstrapGetBootstrapAgentsParams {
o.SetOptsSelector(optsSelector)
return o
}
// SetOptsSelector adds the optsSelector to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsSelector(optsSelector *string) {
o.OptsSelector = optsSelector
}
// WithOptsURLScope adds the optsURLScope to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsURLScope(optsURLScope *string) *BootstrapGetBootstrapAgentsParams {
o.SetOptsURLScope(optsURLScope)
return o
}
// SetOptsURLScope adds the optsUrlScope to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsURLScope(optsURLScope *string) {
o.OptsURLScope = optsURLScope
}
// WithOptsUsername adds the optsUsername to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithOptsUsername(optsUsername *string) *BootstrapGetBootstrapAgentsParams {
o.SetOptsUsername(optsUsername)
return o
}
// SetOptsUsername adds the optsUsername to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetOptsUsername(optsUsername *string) {
o.OptsUsername = optsUsername
}
// WithTemplateScope adds the templateScope to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) WithTemplateScope(templateScope string) *BootstrapGetBootstrapAgentsParams {
o.SetTemplateScope(templateScope)
return o
}
// SetTemplateScope adds the templateScope to the bootstrap get bootstrap agents params
func (o *BootstrapGetBootstrapAgentsParams) SetTemplateScope(templateScope string) {
o.TemplateScope = templateScope
}
// WriteToRequest writes these params to a swagger request
func (o *BootstrapGetBootstrapAgentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.OptsID != nil {
// query param opts.ID
var qrOptsID string
if o.OptsID != nil {
qrOptsID = *o.OptsID
}
qOptsID := qrOptsID
if qOptsID != "" {
if err := r.SetQueryParam("opts.ID", qOptsID); err != nil {
return err
}
}
}
if o.OptsAccount != nil {
// query param opts.account
var qrOptsAccount string
if o.OptsAccount != nil {
qrOptsAccount = *o.OptsAccount
}
qOptsAccount := qrOptsAccount
if qOptsAccount != "" {
if err := r.SetQueryParam("opts.account", qOptsAccount); err != nil {
return err
}
}
}
if o.OptsBlueprintRef != nil {
// query param opts.blueprintRef
var qrOptsBlueprintRef string
if o.OptsBlueprintRef != nil {
qrOptsBlueprintRef = *o.OptsBlueprintRef
}
qOptsBlueprintRef := qrOptsBlueprintRef
if qOptsBlueprintRef != "" {
if err := r.SetQueryParam("opts.blueprintRef", qOptsBlueprintRef); err != nil {
return err
}
}
}
if o.OptsClusterID != nil {
// query param opts.clusterID
var qrOptsClusterID string
if o.OptsClusterID != nil {
qrOptsClusterID = *o.OptsClusterID
}
qOptsClusterID := qrOptsClusterID
if qOptsClusterID != "" {
if err := r.SetQueryParam("opts.clusterID", qOptsClusterID); err != nil {
return err
}
}
}
if o.OptsCount != nil {
// query param opts.count
var qrOptsCount string
if o.OptsCount != nil {
qrOptsCount = *o.OptsCount
}
qOptsCount := qrOptsCount
if qOptsCount != "" {
if err := r.SetQueryParam("opts.count", qOptsCount); err != nil {
return err
}
}
}
if o.OptsDeleted != nil {
// query param opts.deleted
var qrOptsDeleted bool
if o.OptsDeleted != nil {
qrOptsDeleted = *o.OptsDeleted
}
qOptsDeleted := swag.FormatBool(qrOptsDeleted)
if qOptsDeleted != "" {
if err := r.SetQueryParam("opts.deleted", qOptsDeleted); err != nil {
return err
}
}
}
if o.OptsDisplayName != nil {
// query param opts.displayName
var qrOptsDisplayName string
if o.OptsDisplayName != nil {
qrOptsDisplayName = *o.OptsDisplayName
}
qOptsDisplayName := qrOptsDisplayName
if qOptsDisplayName != "" {
if err := r.SetQueryParam("opts.displayName", qOptsDisplayName); err != nil {
return err
}
}
}
if o.OptsExtended != nil {
// query param opts.extended
var qrOptsExtended bool
if o.OptsExtended != nil {
qrOptsExtended = *o.OptsExtended
}
qOptsExtended := swag.FormatBool(qrOptsExtended)
if qOptsExtended != "" {
if err := r.SetQueryParam("opts.extended", qOptsExtended); err != nil {
return err
}
}
}
if o.OptsGlobalScope != nil {
// query param opts.globalScope
var qrOptsGlobalScope bool
if o.OptsGlobalScope != nil {
qrOptsGlobalScope = *o.OptsGlobalScope
}
qOptsGlobalScope := swag.FormatBool(qrOptsGlobalScope)
if qOptsGlobalScope != "" {
if err := r.SetQueryParam("opts.globalScope", qOptsGlobalScope); err != nil {
return err
}
}
}
if o.OptsGroups != nil {
// binding items for opts.groups
joinedOptsGroups := o.bindParamOptsGroups(reg)
// query array param opts.groups
if err := r.SetQueryParam("opts.groups", joinedOptsGroups...); err != nil {
return err
}
}
if o.OptsIgnoreScopeDefault != nil {
// query param opts.ignoreScopeDefault
var qrOptsIgnoreScopeDefault bool
if o.OptsIgnoreScopeDefault != nil {
qrOptsIgnoreScopeDefault = *o.OptsIgnoreScopeDefault
}
qOptsIgnoreScopeDefault := swag.FormatBool(qrOptsIgnoreScopeDefault)
if qOptsIgnoreScopeDefault != "" {
if err := r.SetQueryParam("opts.ignoreScopeDefault", qOptsIgnoreScopeDefault); err != nil {
return err
}
}
}
if o.OptsIsSSOUser != nil {
// query param opts.isSSOUser
var qrOptsIsSSOUser bool
if o.OptsIsSSOUser != nil {
qrOptsIsSSOUser = *o.OptsIsSSOUser
}
qOptsIsSSOUser := swag.FormatBool(qrOptsIsSSOUser)
if qOptsIsSSOUser != "" {
if err := r.SetQueryParam("opts.isSSOUser", qOptsIsSSOUser); err != nil {
return err
}
}
}
if o.OptsLimit != nil {
// query param opts.limit
var qrOptsLimit string
if o.OptsLimit != nil {
qrOptsLimit = *o.OptsLimit
}
qOptsLimit := qrOptsLimit
if qOptsLimit != "" {
if err := r.SetQueryParam("opts.limit", qOptsLimit); err != nil {
return err
}
}
}
if o.OptsName != nil {
// query param opts.name
var qrOptsName string
if o.OptsName != nil {
qrOptsName = *o.OptsName
}
qOptsName := qrOptsName
if qOptsName != "" {
if err := r.SetQueryParam("opts.name", qOptsName); err != nil {
return err
}
}
}
if o.OptsOffset != nil {
// query param opts.offset
var qrOptsOffset string
if o.OptsOffset != nil {
qrOptsOffset = *o.OptsOffset
}
qOptsOffset := qrOptsOffset
if qOptsOffset != "" {
if err := r.SetQueryParam("opts.offset", qOptsOffset); err != nil {
return err
}
}
}
if o.OptsOrder != nil {
// query param opts.order
var qrOptsOrder string
if o.OptsOrder != nil {
qrOptsOrder = *o.OptsOrder
}
qOptsOrder := qrOptsOrder
if qOptsOrder != "" {
if err := r.SetQueryParam("opts.order", qOptsOrder); err != nil {
return err
}
}
}
if o.OptsOrderBy != nil {
// query param opts.orderBy
var qrOptsOrderBy string
if o.OptsOrderBy != nil {
qrOptsOrderBy = *o.OptsOrderBy
}
qOptsOrderBy := qrOptsOrderBy
if qOptsOrderBy != "" {
if err := r.SetQueryParam("opts.orderBy", qOptsOrderBy); err != nil {
return err
}
}
}
if o.OptsOrganization != nil {
// query param opts.organization
var qrOptsOrganization string
if o.OptsOrganization != nil {
qrOptsOrganization = *o.OptsOrganization
}
qOptsOrganization := qrOptsOrganization
if qOptsOrganization != "" {
if err := r.SetQueryParam("opts.organization", qOptsOrganization); err != nil {
return err
}
}
}
if o.OptsPartner != nil {
// query param opts.partner
var qrOptsPartner string
if o.OptsPartner != nil {
qrOptsPartner = *o.OptsPartner
}
qOptsPartner := qrOptsPartner
if qOptsPartner != "" {
if err := r.SetQueryParam("opts.partner", qOptsPartner); err != nil {
return err
}
}
}
if o.OptsProject != nil {
// query param opts.project
var qrOptsProject string
if o.OptsProject != nil {
qrOptsProject = *o.OptsProject
}
qOptsProject := qrOptsProject
if qOptsProject != "" {
if err := r.SetQueryParam("opts.project", qOptsProject); err != nil {
return err
}
}
}
if o.OptsPublishedVersion != nil {
// query param opts.publishedVersion
var qrOptsPublishedVersion string
if o.OptsPublishedVersion != nil {
qrOptsPublishedVersion = *o.OptsPublishedVersion
}
qOptsPublishedVersion := qrOptsPublishedVersion
if qOptsPublishedVersion != "" {
if err := r.SetQueryParam("opts.publishedVersion", qOptsPublishedVersion); err != nil {
return err
}
}
}
if o.OptsSelector != nil {
// query param opts.selector
var qrOptsSelector string
if o.OptsSelector != nil {
qrOptsSelector = *o.OptsSelector
}
qOptsSelector := qrOptsSelector
if qOptsSelector != "" {
if err := r.SetQueryParam("opts.selector", qOptsSelector); err != nil {
return err
}
}
}
if o.OptsURLScope != nil {
// query param opts.urlScope
var qrOptsURLScope string
if o.OptsURLScope != nil {
qrOptsURLScope = *o.OptsURLScope
}
qOptsURLScope := qrOptsURLScope
if qOptsURLScope != "" {
if err := r.SetQueryParam("opts.urlScope", qOptsURLScope); err != nil {
return err
}
}
}
if o.OptsUsername != nil {
// query param opts.username
var qrOptsUsername string
if o.OptsUsername != nil {
qrOptsUsername = *o.OptsUsername
}
qOptsUsername := qrOptsUsername
if qOptsUsername != "" {
if err := r.SetQueryParam("opts.username", qOptsUsername); err != nil {
return err
}
}
}
// path param templateScope
if err := r.SetPathParam("templateScope", o.TemplateScope); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// bindParamBootstrapGetBootstrapAgents binds the parameter opts.groups
func (o *BootstrapGetBootstrapAgentsParams) bindParamOptsGroups(formats strfmt.Registry) []string {
optsGroupsIR := o.OptsGroups
var optsGroupsIC []string
for _, optsGroupsIIR := range optsGroupsIR { // explode []string
optsGroupsIIV := optsGroupsIIR // string as string
optsGroupsIC = append(optsGroupsIC, optsGroupsIIV)
}
// items.CollectionFormat: "multi"
optsGroupsIS := swag.JoinByFormat(optsGroupsIC, "multi")
return optsGroupsIS
}

View File

@@ -0,0 +1,223 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/models"
)
// BootstrapGetBootstrapAgentsReader is a Reader for the BootstrapGetBootstrapAgents structure.
type BootstrapGetBootstrapAgentsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *BootstrapGetBootstrapAgentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewBootstrapGetBootstrapAgentsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewBootstrapGetBootstrapAgentsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewBootstrapGetBootstrapAgentsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewBootstrapGetBootstrapAgentsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewBootstrapGetBootstrapAgentsDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewBootstrapGetBootstrapAgentsOK creates a BootstrapGetBootstrapAgentsOK with default headers values
func NewBootstrapGetBootstrapAgentsOK() *BootstrapGetBootstrapAgentsOK {
return &BootstrapGetBootstrapAgentsOK{}
}
/* BootstrapGetBootstrapAgentsOK describes a response with status code 200, with default header values.
A successful response.
*/
type BootstrapGetBootstrapAgentsOK struct {
Payload *models.SentryBootstrapAgentList
}
func (o *BootstrapGetBootstrapAgentsOK) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/{templateScope}/agent][%d] bootstrapGetBootstrapAgentsOK %+v", 200, o.Payload)
}
func (o *BootstrapGetBootstrapAgentsOK) GetPayload() *models.SentryBootstrapAgentList {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.SentryBootstrapAgentList)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapAgentsForbidden creates a BootstrapGetBootstrapAgentsForbidden with default headers values
func NewBootstrapGetBootstrapAgentsForbidden() *BootstrapGetBootstrapAgentsForbidden {
return &BootstrapGetBootstrapAgentsForbidden{}
}
/* BootstrapGetBootstrapAgentsForbidden describes a response with status code 403, with default header values.
Returned when the user does not have permission to access the resource.
*/
type BootstrapGetBootstrapAgentsForbidden struct {
Payload interface{}
}
func (o *BootstrapGetBootstrapAgentsForbidden) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/{templateScope}/agent][%d] bootstrapGetBootstrapAgentsForbidden %+v", 403, o.Payload)
}
func (o *BootstrapGetBootstrapAgentsForbidden) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapAgentsNotFound creates a BootstrapGetBootstrapAgentsNotFound with default headers values
func NewBootstrapGetBootstrapAgentsNotFound() *BootstrapGetBootstrapAgentsNotFound {
return &BootstrapGetBootstrapAgentsNotFound{}
}
/* BootstrapGetBootstrapAgentsNotFound describes a response with status code 404, with default header values.
Returned when the resource does not exist.
*/
type BootstrapGetBootstrapAgentsNotFound struct {
Payload interface{}
}
func (o *BootstrapGetBootstrapAgentsNotFound) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/{templateScope}/agent][%d] bootstrapGetBootstrapAgentsNotFound %+v", 404, o.Payload)
}
func (o *BootstrapGetBootstrapAgentsNotFound) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapAgentsInternalServerError creates a BootstrapGetBootstrapAgentsInternalServerError with default headers values
func NewBootstrapGetBootstrapAgentsInternalServerError() *BootstrapGetBootstrapAgentsInternalServerError {
return &BootstrapGetBootstrapAgentsInternalServerError{}
}
/* BootstrapGetBootstrapAgentsInternalServerError describes a response with status code 500, with default header values.
Returned for internal server error
*/
type BootstrapGetBootstrapAgentsInternalServerError struct {
Payload interface{}
}
func (o *BootstrapGetBootstrapAgentsInternalServerError) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/{templateScope}/agent][%d] bootstrapGetBootstrapAgentsInternalServerError %+v", 500, o.Payload)
}
func (o *BootstrapGetBootstrapAgentsInternalServerError) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapAgentsDefault creates a BootstrapGetBootstrapAgentsDefault with default headers values
func NewBootstrapGetBootstrapAgentsDefault(code int) *BootstrapGetBootstrapAgentsDefault {
return &BootstrapGetBootstrapAgentsDefault{
_statusCode: code,
}
}
/* BootstrapGetBootstrapAgentsDefault describes a response with status code -1, with default header values.
An unexpected error response.
*/
type BootstrapGetBootstrapAgentsDefault struct {
_statusCode int
Payload *models.GooglerpcStatus
}
// Code gets the status code for the bootstrap get bootstrap agents default response
func (o *BootstrapGetBootstrapAgentsDefault) Code() int {
return o._statusCode
}
func (o *BootstrapGetBootstrapAgentsDefault) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/{templateScope}/agent][%d] Bootstrap_GetBootstrapAgents default %+v", o._statusCode, o.Payload)
}
func (o *BootstrapGetBootstrapAgentsDefault) GetPayload() *models.GooglerpcStatus {
return o.Payload
}
func (o *BootstrapGetBootstrapAgentsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.GooglerpcStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@@ -0,0 +1,562 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewBootstrapGetBootstrapInfraParams creates a new BootstrapGetBootstrapInfraParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewBootstrapGetBootstrapInfraParams() *BootstrapGetBootstrapInfraParams {
return &BootstrapGetBootstrapInfraParams{
timeout: cr.DefaultTimeout,
}
}
// NewBootstrapGetBootstrapInfraParamsWithTimeout creates a new BootstrapGetBootstrapInfraParams object
// with the ability to set a timeout on a request.
func NewBootstrapGetBootstrapInfraParamsWithTimeout(timeout time.Duration) *BootstrapGetBootstrapInfraParams {
return &BootstrapGetBootstrapInfraParams{
timeout: timeout,
}
}
// NewBootstrapGetBootstrapInfraParamsWithContext creates a new BootstrapGetBootstrapInfraParams object
// with the ability to set a context for a request.
func NewBootstrapGetBootstrapInfraParamsWithContext(ctx context.Context) *BootstrapGetBootstrapInfraParams {
return &BootstrapGetBootstrapInfraParams{
Context: ctx,
}
}
// NewBootstrapGetBootstrapInfraParamsWithHTTPClient creates a new BootstrapGetBootstrapInfraParams object
// with the ability to set a custom HTTPClient for a request.
func NewBootstrapGetBootstrapInfraParamsWithHTTPClient(client *http.Client) *BootstrapGetBootstrapInfraParams {
return &BootstrapGetBootstrapInfraParams{
HTTPClient: client,
}
}
/* BootstrapGetBootstrapInfraParams contains all the parameters to send to the API endpoint
for the bootstrap get bootstrap infra operation.
Typically these are written to a http.Request.
*/
type BootstrapGetBootstrapInfraParams struct {
/* APIVersion.
API Version. API Version of the resource
Default: "infra.k8smgmt.io/v3"
*/
APIVersion *string
/* Kind.
Kind. Kind of the resource
Default: "BootstrapInfra"
*/
Kind *string
/* MetadataDescription.
Description. description of the resource
*/
MetadataDescription *string
/* MetadataDisplayName.
Display Name. display name of the resource
*/
MetadataDisplayName *string
// MetadataID.
MetadataID *string
// MetadataModifiedAt.
//
// Format: date-time
MetadataModifiedAt *strfmt.DateTime
/* MetadataName.
name of the resource
*/
MetadataName string
/* MetadataOrganization.
Organization. Organization to which the resource belongs
*/
MetadataOrganization *string
/* MetadataPartner.
Partner. Partner to which the resource belongs
*/
MetadataPartner *string
/* MetadataProject.
Project. Project of the resource
*/
MetadataProject *string
// SpecCaCert.
SpecCaCert *string
// SpecCaKey.
SpecCaKey *string
// SpecCaKeyPass.
SpecCaKeyPass *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the bootstrap get bootstrap infra params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapGetBootstrapInfraParams) WithDefaults() *BootstrapGetBootstrapInfraParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the bootstrap get bootstrap infra params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapGetBootstrapInfraParams) SetDefaults() {
var (
aPIVersionDefault = string("infra.k8smgmt.io/v3")
kindDefault = string("BootstrapInfra")
)
val := BootstrapGetBootstrapInfraParams{
APIVersion: &aPIVersionDefault,
Kind: &kindDefault,
}
val.timeout = o.timeout
val.Context = o.Context
val.HTTPClient = o.HTTPClient
*o = val
}
// WithTimeout adds the timeout to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) WithTimeout(timeout time.Duration) *BootstrapGetBootstrapInfraParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) WithContext(ctx context.Context) *BootstrapGetBootstrapInfraParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) WithHTTPClient(client *http.Client) *BootstrapGetBootstrapInfraParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAPIVersion adds the aPIVersion to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) WithAPIVersion(aPIVersion *string) *BootstrapGetBootstrapInfraParams {
o.SetAPIVersion(aPIVersion)
return o
}
// SetAPIVersion adds the apiVersion to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) SetAPIVersion(aPIVersion *string) {
o.APIVersion = aPIVersion
}
// WithKind adds the kind to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) WithKind(kind *string) *BootstrapGetBootstrapInfraParams {
o.SetKind(kind)
return o
}
// SetKind adds the kind to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) SetKind(kind *string) {
o.Kind = kind
}
// WithMetadataDescription adds the metadataDescription to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) WithMetadataDescription(metadataDescription *string) *BootstrapGetBootstrapInfraParams {
o.SetMetadataDescription(metadataDescription)
return o
}
// SetMetadataDescription adds the metadataDescription to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) SetMetadataDescription(metadataDescription *string) {
o.MetadataDescription = metadataDescription
}
// WithMetadataDisplayName adds the metadataDisplayName to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) WithMetadataDisplayName(metadataDisplayName *string) *BootstrapGetBootstrapInfraParams {
o.SetMetadataDisplayName(metadataDisplayName)
return o
}
// SetMetadataDisplayName adds the metadataDisplayName to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) SetMetadataDisplayName(metadataDisplayName *string) {
o.MetadataDisplayName = metadataDisplayName
}
// WithMetadataID adds the metadataID to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) WithMetadataID(metadataID *string) *BootstrapGetBootstrapInfraParams {
o.SetMetadataID(metadataID)
return o
}
// SetMetadataID adds the metadataId to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) SetMetadataID(metadataID *string) {
o.MetadataID = metadataID
}
// WithMetadataModifiedAt adds the metadataModifiedAt to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) WithMetadataModifiedAt(metadataModifiedAt *strfmt.DateTime) *BootstrapGetBootstrapInfraParams {
o.SetMetadataModifiedAt(metadataModifiedAt)
return o
}
// SetMetadataModifiedAt adds the metadataModifiedAt to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) SetMetadataModifiedAt(metadataModifiedAt *strfmt.DateTime) {
o.MetadataModifiedAt = metadataModifiedAt
}
// WithMetadataName adds the metadataName to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) WithMetadataName(metadataName string) *BootstrapGetBootstrapInfraParams {
o.SetMetadataName(metadataName)
return o
}
// SetMetadataName adds the metadataName to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) SetMetadataName(metadataName string) {
o.MetadataName = metadataName
}
// WithMetadataOrganization adds the metadataOrganization to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) WithMetadataOrganization(metadataOrganization *string) *BootstrapGetBootstrapInfraParams {
o.SetMetadataOrganization(metadataOrganization)
return o
}
// SetMetadataOrganization adds the metadataOrganization to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) SetMetadataOrganization(metadataOrganization *string) {
o.MetadataOrganization = metadataOrganization
}
// WithMetadataPartner adds the metadataPartner to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) WithMetadataPartner(metadataPartner *string) *BootstrapGetBootstrapInfraParams {
o.SetMetadataPartner(metadataPartner)
return o
}
// SetMetadataPartner adds the metadataPartner to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) SetMetadataPartner(metadataPartner *string) {
o.MetadataPartner = metadataPartner
}
// WithMetadataProject adds the metadataProject to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) WithMetadataProject(metadataProject *string) *BootstrapGetBootstrapInfraParams {
o.SetMetadataProject(metadataProject)
return o
}
// SetMetadataProject adds the metadataProject to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) SetMetadataProject(metadataProject *string) {
o.MetadataProject = metadataProject
}
// WithSpecCaCert adds the specCaCert to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) WithSpecCaCert(specCaCert *string) *BootstrapGetBootstrapInfraParams {
o.SetSpecCaCert(specCaCert)
return o
}
// SetSpecCaCert adds the specCaCert to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) SetSpecCaCert(specCaCert *string) {
o.SpecCaCert = specCaCert
}
// WithSpecCaKey adds the specCaKey to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) WithSpecCaKey(specCaKey *string) *BootstrapGetBootstrapInfraParams {
o.SetSpecCaKey(specCaKey)
return o
}
// SetSpecCaKey adds the specCaKey to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) SetSpecCaKey(specCaKey *string) {
o.SpecCaKey = specCaKey
}
// WithSpecCaKeyPass adds the specCaKeyPass to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) WithSpecCaKeyPass(specCaKeyPass *string) *BootstrapGetBootstrapInfraParams {
o.SetSpecCaKeyPass(specCaKeyPass)
return o
}
// SetSpecCaKeyPass adds the specCaKeyPass to the bootstrap get bootstrap infra params
func (o *BootstrapGetBootstrapInfraParams) SetSpecCaKeyPass(specCaKeyPass *string) {
o.SpecCaKeyPass = specCaKeyPass
}
// WriteToRequest writes these params to a swagger request
func (o *BootstrapGetBootstrapInfraParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.APIVersion != nil {
// query param apiVersion
var qrAPIVersion string
if o.APIVersion != nil {
qrAPIVersion = *o.APIVersion
}
qAPIVersion := qrAPIVersion
if qAPIVersion != "" {
if err := r.SetQueryParam("apiVersion", qAPIVersion); err != nil {
return err
}
}
}
if o.Kind != nil {
// query param kind
var qrKind string
if o.Kind != nil {
qrKind = *o.Kind
}
qKind := qrKind
if qKind != "" {
if err := r.SetQueryParam("kind", qKind); err != nil {
return err
}
}
}
if o.MetadataDescription != nil {
// query param metadata.description
var qrMetadataDescription string
if o.MetadataDescription != nil {
qrMetadataDescription = *o.MetadataDescription
}
qMetadataDescription := qrMetadataDescription
if qMetadataDescription != "" {
if err := r.SetQueryParam("metadata.description", qMetadataDescription); err != nil {
return err
}
}
}
if o.MetadataDisplayName != nil {
// query param metadata.displayName
var qrMetadataDisplayName string
if o.MetadataDisplayName != nil {
qrMetadataDisplayName = *o.MetadataDisplayName
}
qMetadataDisplayName := qrMetadataDisplayName
if qMetadataDisplayName != "" {
if err := r.SetQueryParam("metadata.displayName", qMetadataDisplayName); err != nil {
return err
}
}
}
if o.MetadataID != nil {
// query param metadata.id
var qrMetadataID string
if o.MetadataID != nil {
qrMetadataID = *o.MetadataID
}
qMetadataID := qrMetadataID
if qMetadataID != "" {
if err := r.SetQueryParam("metadata.id", qMetadataID); err != nil {
return err
}
}
}
if o.MetadataModifiedAt != nil {
// query param metadata.modifiedAt
var qrMetadataModifiedAt strfmt.DateTime
if o.MetadataModifiedAt != nil {
qrMetadataModifiedAt = *o.MetadataModifiedAt
}
qMetadataModifiedAt := qrMetadataModifiedAt.String()
if qMetadataModifiedAt != "" {
if err := r.SetQueryParam("metadata.modifiedAt", qMetadataModifiedAt); err != nil {
return err
}
}
}
// path param metadata.name
if err := r.SetPathParam("metadata.name", o.MetadataName); err != nil {
return err
}
if o.MetadataOrganization != nil {
// query param metadata.organization
var qrMetadataOrganization string
if o.MetadataOrganization != nil {
qrMetadataOrganization = *o.MetadataOrganization
}
qMetadataOrganization := qrMetadataOrganization
if qMetadataOrganization != "" {
if err := r.SetQueryParam("metadata.organization", qMetadataOrganization); err != nil {
return err
}
}
}
if o.MetadataPartner != nil {
// query param metadata.partner
var qrMetadataPartner string
if o.MetadataPartner != nil {
qrMetadataPartner = *o.MetadataPartner
}
qMetadataPartner := qrMetadataPartner
if qMetadataPartner != "" {
if err := r.SetQueryParam("metadata.partner", qMetadataPartner); err != nil {
return err
}
}
}
if o.MetadataProject != nil {
// query param metadata.project
var qrMetadataProject string
if o.MetadataProject != nil {
qrMetadataProject = *o.MetadataProject
}
qMetadataProject := qrMetadataProject
if qMetadataProject != "" {
if err := r.SetQueryParam("metadata.project", qMetadataProject); err != nil {
return err
}
}
}
if o.SpecCaCert != nil {
// query param spec.caCert
var qrSpecCaCert string
if o.SpecCaCert != nil {
qrSpecCaCert = *o.SpecCaCert
}
qSpecCaCert := qrSpecCaCert
if qSpecCaCert != "" {
if err := r.SetQueryParam("spec.caCert", qSpecCaCert); err != nil {
return err
}
}
}
if o.SpecCaKey != nil {
// query param spec.caKey
var qrSpecCaKey string
if o.SpecCaKey != nil {
qrSpecCaKey = *o.SpecCaKey
}
qSpecCaKey := qrSpecCaKey
if qSpecCaKey != "" {
if err := r.SetQueryParam("spec.caKey", qSpecCaKey); err != nil {
return err
}
}
}
if o.SpecCaKeyPass != nil {
// query param spec.caKeyPass
var qrSpecCaKeyPass string
if o.SpecCaKeyPass != nil {
qrSpecCaKeyPass = *o.SpecCaKeyPass
}
qSpecCaKeyPass := qrSpecCaKeyPass
if qSpecCaKeyPass != "" {
if err := r.SetQueryParam("spec.caKeyPass", qSpecCaKeyPass); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,223 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/models"
)
// BootstrapGetBootstrapInfraReader is a Reader for the BootstrapGetBootstrapInfra structure.
type BootstrapGetBootstrapInfraReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *BootstrapGetBootstrapInfraReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewBootstrapGetBootstrapInfraOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewBootstrapGetBootstrapInfraForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewBootstrapGetBootstrapInfraNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewBootstrapGetBootstrapInfraInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewBootstrapGetBootstrapInfraDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewBootstrapGetBootstrapInfraOK creates a BootstrapGetBootstrapInfraOK with default headers values
func NewBootstrapGetBootstrapInfraOK() *BootstrapGetBootstrapInfraOK {
return &BootstrapGetBootstrapInfraOK{}
}
/* BootstrapGetBootstrapInfraOK describes a response with status code 200, with default header values.
A successful response.
*/
type BootstrapGetBootstrapInfraOK struct {
Payload *models.SentryBootstrapInfra
}
func (o *BootstrapGetBootstrapInfraOK) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/infra/{metadata.name}][%d] bootstrapGetBootstrapInfraOK %+v", 200, o.Payload)
}
func (o *BootstrapGetBootstrapInfraOK) GetPayload() *models.SentryBootstrapInfra {
return o.Payload
}
func (o *BootstrapGetBootstrapInfraOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.SentryBootstrapInfra)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapInfraForbidden creates a BootstrapGetBootstrapInfraForbidden with default headers values
func NewBootstrapGetBootstrapInfraForbidden() *BootstrapGetBootstrapInfraForbidden {
return &BootstrapGetBootstrapInfraForbidden{}
}
/* BootstrapGetBootstrapInfraForbidden describes a response with status code 403, with default header values.
Returned when the user does not have permission to access the resource.
*/
type BootstrapGetBootstrapInfraForbidden struct {
Payload interface{}
}
func (o *BootstrapGetBootstrapInfraForbidden) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/infra/{metadata.name}][%d] bootstrapGetBootstrapInfraForbidden %+v", 403, o.Payload)
}
func (o *BootstrapGetBootstrapInfraForbidden) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapGetBootstrapInfraForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapInfraNotFound creates a BootstrapGetBootstrapInfraNotFound with default headers values
func NewBootstrapGetBootstrapInfraNotFound() *BootstrapGetBootstrapInfraNotFound {
return &BootstrapGetBootstrapInfraNotFound{}
}
/* BootstrapGetBootstrapInfraNotFound describes a response with status code 404, with default header values.
Returned when the resource does not exist.
*/
type BootstrapGetBootstrapInfraNotFound struct {
Payload interface{}
}
func (o *BootstrapGetBootstrapInfraNotFound) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/infra/{metadata.name}][%d] bootstrapGetBootstrapInfraNotFound %+v", 404, o.Payload)
}
func (o *BootstrapGetBootstrapInfraNotFound) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapGetBootstrapInfraNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapInfraInternalServerError creates a BootstrapGetBootstrapInfraInternalServerError with default headers values
func NewBootstrapGetBootstrapInfraInternalServerError() *BootstrapGetBootstrapInfraInternalServerError {
return &BootstrapGetBootstrapInfraInternalServerError{}
}
/* BootstrapGetBootstrapInfraInternalServerError describes a response with status code 500, with default header values.
Returned for internal server error
*/
type BootstrapGetBootstrapInfraInternalServerError struct {
Payload interface{}
}
func (o *BootstrapGetBootstrapInfraInternalServerError) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/infra/{metadata.name}][%d] bootstrapGetBootstrapInfraInternalServerError %+v", 500, o.Payload)
}
func (o *BootstrapGetBootstrapInfraInternalServerError) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapGetBootstrapInfraInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapGetBootstrapInfraDefault creates a BootstrapGetBootstrapInfraDefault with default headers values
func NewBootstrapGetBootstrapInfraDefault(code int) *BootstrapGetBootstrapInfraDefault {
return &BootstrapGetBootstrapInfraDefault{
_statusCode: code,
}
}
/* BootstrapGetBootstrapInfraDefault describes a response with status code -1, with default header values.
An unexpected error response.
*/
type BootstrapGetBootstrapInfraDefault struct {
_statusCode int
Payload *models.GooglerpcStatus
}
// Code gets the status code for the bootstrap get bootstrap infra default response
func (o *BootstrapGetBootstrapInfraDefault) Code() int {
return o._statusCode
}
func (o *BootstrapGetBootstrapInfraDefault) Error() string {
return fmt.Sprintf("[GET /v2/sentry/bootstrap/infra/{metadata.name}][%d] Bootstrap_GetBootstrapInfra default %+v", o._statusCode, o.Payload)
}
func (o *BootstrapGetBootstrapInfraDefault) GetPayload() *models.GooglerpcStatus {
return o.Payload
}
func (o *BootstrapGetBootstrapInfraDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.GooglerpcStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@@ -0,0 +1,170 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/models"
)
// NewBootstrapPatchBootstrapAgentTemplateParams creates a new BootstrapPatchBootstrapAgentTemplateParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewBootstrapPatchBootstrapAgentTemplateParams() *BootstrapPatchBootstrapAgentTemplateParams {
return &BootstrapPatchBootstrapAgentTemplateParams{
timeout: cr.DefaultTimeout,
}
}
// NewBootstrapPatchBootstrapAgentTemplateParamsWithTimeout creates a new BootstrapPatchBootstrapAgentTemplateParams object
// with the ability to set a timeout on a request.
func NewBootstrapPatchBootstrapAgentTemplateParamsWithTimeout(timeout time.Duration) *BootstrapPatchBootstrapAgentTemplateParams {
return &BootstrapPatchBootstrapAgentTemplateParams{
timeout: timeout,
}
}
// NewBootstrapPatchBootstrapAgentTemplateParamsWithContext creates a new BootstrapPatchBootstrapAgentTemplateParams object
// with the ability to set a context for a request.
func NewBootstrapPatchBootstrapAgentTemplateParamsWithContext(ctx context.Context) *BootstrapPatchBootstrapAgentTemplateParams {
return &BootstrapPatchBootstrapAgentTemplateParams{
Context: ctx,
}
}
// NewBootstrapPatchBootstrapAgentTemplateParamsWithHTTPClient creates a new BootstrapPatchBootstrapAgentTemplateParams object
// with the ability to set a custom HTTPClient for a request.
func NewBootstrapPatchBootstrapAgentTemplateParamsWithHTTPClient(client *http.Client) *BootstrapPatchBootstrapAgentTemplateParams {
return &BootstrapPatchBootstrapAgentTemplateParams{
HTTPClient: client,
}
}
/* BootstrapPatchBootstrapAgentTemplateParams contains all the parameters to send to the API endpoint
for the bootstrap patch bootstrap agent template operation.
Typically these are written to a http.Request.
*/
type BootstrapPatchBootstrapAgentTemplateParams struct {
// Body.
Body *models.SentryBootstrapAgentTemplate
/* MetadataName.
name of the resource
*/
MetadataName string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the bootstrap patch bootstrap agent template params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapPatchBootstrapAgentTemplateParams) WithDefaults() *BootstrapPatchBootstrapAgentTemplateParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the bootstrap patch bootstrap agent template params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapPatchBootstrapAgentTemplateParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the bootstrap patch bootstrap agent template params
func (o *BootstrapPatchBootstrapAgentTemplateParams) WithTimeout(timeout time.Duration) *BootstrapPatchBootstrapAgentTemplateParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the bootstrap patch bootstrap agent template params
func (o *BootstrapPatchBootstrapAgentTemplateParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the bootstrap patch bootstrap agent template params
func (o *BootstrapPatchBootstrapAgentTemplateParams) WithContext(ctx context.Context) *BootstrapPatchBootstrapAgentTemplateParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the bootstrap patch bootstrap agent template params
func (o *BootstrapPatchBootstrapAgentTemplateParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the bootstrap patch bootstrap agent template params
func (o *BootstrapPatchBootstrapAgentTemplateParams) WithHTTPClient(client *http.Client) *BootstrapPatchBootstrapAgentTemplateParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the bootstrap patch bootstrap agent template params
func (o *BootstrapPatchBootstrapAgentTemplateParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the bootstrap patch bootstrap agent template params
func (o *BootstrapPatchBootstrapAgentTemplateParams) WithBody(body *models.SentryBootstrapAgentTemplate) *BootstrapPatchBootstrapAgentTemplateParams {
o.SetBody(body)
return o
}
// SetBody adds the body to the bootstrap patch bootstrap agent template params
func (o *BootstrapPatchBootstrapAgentTemplateParams) SetBody(body *models.SentryBootstrapAgentTemplate) {
o.Body = body
}
// WithMetadataName adds the metadataName to the bootstrap patch bootstrap agent template params
func (o *BootstrapPatchBootstrapAgentTemplateParams) WithMetadataName(metadataName string) *BootstrapPatchBootstrapAgentTemplateParams {
o.SetMetadataName(metadataName)
return o
}
// SetMetadataName adds the metadataName to the bootstrap patch bootstrap agent template params
func (o *BootstrapPatchBootstrapAgentTemplateParams) SetMetadataName(metadataName string) {
o.MetadataName = metadataName
}
// WriteToRequest writes these params to a swagger request
func (o *BootstrapPatchBootstrapAgentTemplateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Body != nil {
if err := r.SetBodyParam(o.Body); err != nil {
return err
}
}
// path param metadata.name
if err := r.SetPathParam("metadata.name", o.MetadataName); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,223 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/models"
)
// BootstrapPatchBootstrapAgentTemplateReader is a Reader for the BootstrapPatchBootstrapAgentTemplate structure.
type BootstrapPatchBootstrapAgentTemplateReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *BootstrapPatchBootstrapAgentTemplateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewBootstrapPatchBootstrapAgentTemplateOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewBootstrapPatchBootstrapAgentTemplateForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewBootstrapPatchBootstrapAgentTemplateNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewBootstrapPatchBootstrapAgentTemplateInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewBootstrapPatchBootstrapAgentTemplateDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewBootstrapPatchBootstrapAgentTemplateOK creates a BootstrapPatchBootstrapAgentTemplateOK with default headers values
func NewBootstrapPatchBootstrapAgentTemplateOK() *BootstrapPatchBootstrapAgentTemplateOK {
return &BootstrapPatchBootstrapAgentTemplateOK{}
}
/* BootstrapPatchBootstrapAgentTemplateOK describes a response with status code 200, with default header values.
A successful response.
*/
type BootstrapPatchBootstrapAgentTemplateOK struct {
Payload *models.SentryBootstrapAgentTemplate
}
func (o *BootstrapPatchBootstrapAgentTemplateOK) Error() string {
return fmt.Sprintf("[PUT /v2/sentry/bootstrap/template/{metadata.name}][%d] bootstrapPatchBootstrapAgentTemplateOK %+v", 200, o.Payload)
}
func (o *BootstrapPatchBootstrapAgentTemplateOK) GetPayload() *models.SentryBootstrapAgentTemplate {
return o.Payload
}
func (o *BootstrapPatchBootstrapAgentTemplateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.SentryBootstrapAgentTemplate)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapPatchBootstrapAgentTemplateForbidden creates a BootstrapPatchBootstrapAgentTemplateForbidden with default headers values
func NewBootstrapPatchBootstrapAgentTemplateForbidden() *BootstrapPatchBootstrapAgentTemplateForbidden {
return &BootstrapPatchBootstrapAgentTemplateForbidden{}
}
/* BootstrapPatchBootstrapAgentTemplateForbidden describes a response with status code 403, with default header values.
Returned when the user does not have permission to access the resource.
*/
type BootstrapPatchBootstrapAgentTemplateForbidden struct {
Payload interface{}
}
func (o *BootstrapPatchBootstrapAgentTemplateForbidden) Error() string {
return fmt.Sprintf("[PUT /v2/sentry/bootstrap/template/{metadata.name}][%d] bootstrapPatchBootstrapAgentTemplateForbidden %+v", 403, o.Payload)
}
func (o *BootstrapPatchBootstrapAgentTemplateForbidden) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapPatchBootstrapAgentTemplateForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapPatchBootstrapAgentTemplateNotFound creates a BootstrapPatchBootstrapAgentTemplateNotFound with default headers values
func NewBootstrapPatchBootstrapAgentTemplateNotFound() *BootstrapPatchBootstrapAgentTemplateNotFound {
return &BootstrapPatchBootstrapAgentTemplateNotFound{}
}
/* BootstrapPatchBootstrapAgentTemplateNotFound describes a response with status code 404, with default header values.
Returned when the resource does not exist.
*/
type BootstrapPatchBootstrapAgentTemplateNotFound struct {
Payload interface{}
}
func (o *BootstrapPatchBootstrapAgentTemplateNotFound) Error() string {
return fmt.Sprintf("[PUT /v2/sentry/bootstrap/template/{metadata.name}][%d] bootstrapPatchBootstrapAgentTemplateNotFound %+v", 404, o.Payload)
}
func (o *BootstrapPatchBootstrapAgentTemplateNotFound) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapPatchBootstrapAgentTemplateNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapPatchBootstrapAgentTemplateInternalServerError creates a BootstrapPatchBootstrapAgentTemplateInternalServerError with default headers values
func NewBootstrapPatchBootstrapAgentTemplateInternalServerError() *BootstrapPatchBootstrapAgentTemplateInternalServerError {
return &BootstrapPatchBootstrapAgentTemplateInternalServerError{}
}
/* BootstrapPatchBootstrapAgentTemplateInternalServerError describes a response with status code 500, with default header values.
Returned for internal server error
*/
type BootstrapPatchBootstrapAgentTemplateInternalServerError struct {
Payload interface{}
}
func (o *BootstrapPatchBootstrapAgentTemplateInternalServerError) Error() string {
return fmt.Sprintf("[PUT /v2/sentry/bootstrap/template/{metadata.name}][%d] bootstrapPatchBootstrapAgentTemplateInternalServerError %+v", 500, o.Payload)
}
func (o *BootstrapPatchBootstrapAgentTemplateInternalServerError) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapPatchBootstrapAgentTemplateInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapPatchBootstrapAgentTemplateDefault creates a BootstrapPatchBootstrapAgentTemplateDefault with default headers values
func NewBootstrapPatchBootstrapAgentTemplateDefault(code int) *BootstrapPatchBootstrapAgentTemplateDefault {
return &BootstrapPatchBootstrapAgentTemplateDefault{
_statusCode: code,
}
}
/* BootstrapPatchBootstrapAgentTemplateDefault describes a response with status code -1, with default header values.
An unexpected error response.
*/
type BootstrapPatchBootstrapAgentTemplateDefault struct {
_statusCode int
Payload *models.GooglerpcStatus
}
// Code gets the status code for the bootstrap patch bootstrap agent template default response
func (o *BootstrapPatchBootstrapAgentTemplateDefault) Code() int {
return o._statusCode
}
func (o *BootstrapPatchBootstrapAgentTemplateDefault) Error() string {
return fmt.Sprintf("[PUT /v2/sentry/bootstrap/template/{metadata.name}][%d] Bootstrap_PatchBootstrapAgentTemplate default %+v", o._statusCode, o.Payload)
}
func (o *BootstrapPatchBootstrapAgentTemplateDefault) GetPayload() *models.GooglerpcStatus {
return o.Payload
}
func (o *BootstrapPatchBootstrapAgentTemplateDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.GooglerpcStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@@ -0,0 +1,170 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/models"
)
// NewBootstrapPatchBootstrapInfraParams creates a new BootstrapPatchBootstrapInfraParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewBootstrapPatchBootstrapInfraParams() *BootstrapPatchBootstrapInfraParams {
return &BootstrapPatchBootstrapInfraParams{
timeout: cr.DefaultTimeout,
}
}
// NewBootstrapPatchBootstrapInfraParamsWithTimeout creates a new BootstrapPatchBootstrapInfraParams object
// with the ability to set a timeout on a request.
func NewBootstrapPatchBootstrapInfraParamsWithTimeout(timeout time.Duration) *BootstrapPatchBootstrapInfraParams {
return &BootstrapPatchBootstrapInfraParams{
timeout: timeout,
}
}
// NewBootstrapPatchBootstrapInfraParamsWithContext creates a new BootstrapPatchBootstrapInfraParams object
// with the ability to set a context for a request.
func NewBootstrapPatchBootstrapInfraParamsWithContext(ctx context.Context) *BootstrapPatchBootstrapInfraParams {
return &BootstrapPatchBootstrapInfraParams{
Context: ctx,
}
}
// NewBootstrapPatchBootstrapInfraParamsWithHTTPClient creates a new BootstrapPatchBootstrapInfraParams object
// with the ability to set a custom HTTPClient for a request.
func NewBootstrapPatchBootstrapInfraParamsWithHTTPClient(client *http.Client) *BootstrapPatchBootstrapInfraParams {
return &BootstrapPatchBootstrapInfraParams{
HTTPClient: client,
}
}
/* BootstrapPatchBootstrapInfraParams contains all the parameters to send to the API endpoint
for the bootstrap patch bootstrap infra operation.
Typically these are written to a http.Request.
*/
type BootstrapPatchBootstrapInfraParams struct {
// Body.
Body *models.SentryBootstrapInfra
/* MetadataName.
name of the resource
*/
MetadataName string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the bootstrap patch bootstrap infra params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapPatchBootstrapInfraParams) WithDefaults() *BootstrapPatchBootstrapInfraParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the bootstrap patch bootstrap infra params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapPatchBootstrapInfraParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the bootstrap patch bootstrap infra params
func (o *BootstrapPatchBootstrapInfraParams) WithTimeout(timeout time.Duration) *BootstrapPatchBootstrapInfraParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the bootstrap patch bootstrap infra params
func (o *BootstrapPatchBootstrapInfraParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the bootstrap patch bootstrap infra params
func (o *BootstrapPatchBootstrapInfraParams) WithContext(ctx context.Context) *BootstrapPatchBootstrapInfraParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the bootstrap patch bootstrap infra params
func (o *BootstrapPatchBootstrapInfraParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the bootstrap patch bootstrap infra params
func (o *BootstrapPatchBootstrapInfraParams) WithHTTPClient(client *http.Client) *BootstrapPatchBootstrapInfraParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the bootstrap patch bootstrap infra params
func (o *BootstrapPatchBootstrapInfraParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the bootstrap patch bootstrap infra params
func (o *BootstrapPatchBootstrapInfraParams) WithBody(body *models.SentryBootstrapInfra) *BootstrapPatchBootstrapInfraParams {
o.SetBody(body)
return o
}
// SetBody adds the body to the bootstrap patch bootstrap infra params
func (o *BootstrapPatchBootstrapInfraParams) SetBody(body *models.SentryBootstrapInfra) {
o.Body = body
}
// WithMetadataName adds the metadataName to the bootstrap patch bootstrap infra params
func (o *BootstrapPatchBootstrapInfraParams) WithMetadataName(metadataName string) *BootstrapPatchBootstrapInfraParams {
o.SetMetadataName(metadataName)
return o
}
// SetMetadataName adds the metadataName to the bootstrap patch bootstrap infra params
func (o *BootstrapPatchBootstrapInfraParams) SetMetadataName(metadataName string) {
o.MetadataName = metadataName
}
// WriteToRequest writes these params to a swagger request
func (o *BootstrapPatchBootstrapInfraParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Body != nil {
if err := r.SetBodyParam(o.Body); err != nil {
return err
}
}
// path param metadata.name
if err := r.SetPathParam("metadata.name", o.MetadataName); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,223 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/models"
)
// BootstrapPatchBootstrapInfraReader is a Reader for the BootstrapPatchBootstrapInfra structure.
type BootstrapPatchBootstrapInfraReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *BootstrapPatchBootstrapInfraReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewBootstrapPatchBootstrapInfraOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewBootstrapPatchBootstrapInfraForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewBootstrapPatchBootstrapInfraNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewBootstrapPatchBootstrapInfraInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewBootstrapPatchBootstrapInfraDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewBootstrapPatchBootstrapInfraOK creates a BootstrapPatchBootstrapInfraOK with default headers values
func NewBootstrapPatchBootstrapInfraOK() *BootstrapPatchBootstrapInfraOK {
return &BootstrapPatchBootstrapInfraOK{}
}
/* BootstrapPatchBootstrapInfraOK describes a response with status code 200, with default header values.
A successful response.
*/
type BootstrapPatchBootstrapInfraOK struct {
Payload *models.SentryBootstrapInfra
}
func (o *BootstrapPatchBootstrapInfraOK) Error() string {
return fmt.Sprintf("[PUT /v2/sentry/bootstrap/infra/{metadata.name}][%d] bootstrapPatchBootstrapInfraOK %+v", 200, o.Payload)
}
func (o *BootstrapPatchBootstrapInfraOK) GetPayload() *models.SentryBootstrapInfra {
return o.Payload
}
func (o *BootstrapPatchBootstrapInfraOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.SentryBootstrapInfra)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapPatchBootstrapInfraForbidden creates a BootstrapPatchBootstrapInfraForbidden with default headers values
func NewBootstrapPatchBootstrapInfraForbidden() *BootstrapPatchBootstrapInfraForbidden {
return &BootstrapPatchBootstrapInfraForbidden{}
}
/* BootstrapPatchBootstrapInfraForbidden describes a response with status code 403, with default header values.
Returned when the user does not have permission to access the resource.
*/
type BootstrapPatchBootstrapInfraForbidden struct {
Payload interface{}
}
func (o *BootstrapPatchBootstrapInfraForbidden) Error() string {
return fmt.Sprintf("[PUT /v2/sentry/bootstrap/infra/{metadata.name}][%d] bootstrapPatchBootstrapInfraForbidden %+v", 403, o.Payload)
}
func (o *BootstrapPatchBootstrapInfraForbidden) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapPatchBootstrapInfraForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapPatchBootstrapInfraNotFound creates a BootstrapPatchBootstrapInfraNotFound with default headers values
func NewBootstrapPatchBootstrapInfraNotFound() *BootstrapPatchBootstrapInfraNotFound {
return &BootstrapPatchBootstrapInfraNotFound{}
}
/* BootstrapPatchBootstrapInfraNotFound describes a response with status code 404, with default header values.
Returned when the resource does not exist.
*/
type BootstrapPatchBootstrapInfraNotFound struct {
Payload interface{}
}
func (o *BootstrapPatchBootstrapInfraNotFound) Error() string {
return fmt.Sprintf("[PUT /v2/sentry/bootstrap/infra/{metadata.name}][%d] bootstrapPatchBootstrapInfraNotFound %+v", 404, o.Payload)
}
func (o *BootstrapPatchBootstrapInfraNotFound) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapPatchBootstrapInfraNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapPatchBootstrapInfraInternalServerError creates a BootstrapPatchBootstrapInfraInternalServerError with default headers values
func NewBootstrapPatchBootstrapInfraInternalServerError() *BootstrapPatchBootstrapInfraInternalServerError {
return &BootstrapPatchBootstrapInfraInternalServerError{}
}
/* BootstrapPatchBootstrapInfraInternalServerError describes a response with status code 500, with default header values.
Returned for internal server error
*/
type BootstrapPatchBootstrapInfraInternalServerError struct {
Payload interface{}
}
func (o *BootstrapPatchBootstrapInfraInternalServerError) Error() string {
return fmt.Sprintf("[PUT /v2/sentry/bootstrap/infra/{metadata.name}][%d] bootstrapPatchBootstrapInfraInternalServerError %+v", 500, o.Payload)
}
func (o *BootstrapPatchBootstrapInfraInternalServerError) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapPatchBootstrapInfraInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapPatchBootstrapInfraDefault creates a BootstrapPatchBootstrapInfraDefault with default headers values
func NewBootstrapPatchBootstrapInfraDefault(code int) *BootstrapPatchBootstrapInfraDefault {
return &BootstrapPatchBootstrapInfraDefault{
_statusCode: code,
}
}
/* BootstrapPatchBootstrapInfraDefault describes a response with status code -1, with default header values.
An unexpected error response.
*/
type BootstrapPatchBootstrapInfraDefault struct {
_statusCode int
Payload *models.GooglerpcStatus
}
// Code gets the status code for the bootstrap patch bootstrap infra default response
func (o *BootstrapPatchBootstrapInfraDefault) Code() int {
return o._statusCode
}
func (o *BootstrapPatchBootstrapInfraDefault) Error() string {
return fmt.Sprintf("[PUT /v2/sentry/bootstrap/infra/{metadata.name}][%d] Bootstrap_PatchBootstrapInfra default %+v", o._statusCode, o.Payload)
}
func (o *BootstrapPatchBootstrapInfraDefault) GetPayload() *models.GooglerpcStatus {
return o.Payload
}
func (o *BootstrapPatchBootstrapInfraDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.GooglerpcStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@@ -0,0 +1,163 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewBootstrapRegisterBootstrapAgentParams creates a new BootstrapRegisterBootstrapAgentParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewBootstrapRegisterBootstrapAgentParams() *BootstrapRegisterBootstrapAgentParams {
return &BootstrapRegisterBootstrapAgentParams{
timeout: cr.DefaultTimeout,
}
}
// NewBootstrapRegisterBootstrapAgentParamsWithTimeout creates a new BootstrapRegisterBootstrapAgentParams object
// with the ability to set a timeout on a request.
func NewBootstrapRegisterBootstrapAgentParamsWithTimeout(timeout time.Duration) *BootstrapRegisterBootstrapAgentParams {
return &BootstrapRegisterBootstrapAgentParams{
timeout: timeout,
}
}
// NewBootstrapRegisterBootstrapAgentParamsWithContext creates a new BootstrapRegisterBootstrapAgentParams object
// with the ability to set a context for a request.
func NewBootstrapRegisterBootstrapAgentParamsWithContext(ctx context.Context) *BootstrapRegisterBootstrapAgentParams {
return &BootstrapRegisterBootstrapAgentParams{
Context: ctx,
}
}
// NewBootstrapRegisterBootstrapAgentParamsWithHTTPClient creates a new BootstrapRegisterBootstrapAgentParams object
// with the ability to set a custom HTTPClient for a request.
func NewBootstrapRegisterBootstrapAgentParamsWithHTTPClient(client *http.Client) *BootstrapRegisterBootstrapAgentParams {
return &BootstrapRegisterBootstrapAgentParams{
HTTPClient: client,
}
}
/* BootstrapRegisterBootstrapAgentParams contains all the parameters to send to the API endpoint
for the bootstrap register bootstrap agent operation.
Typically these are written to a http.Request.
*/
type BootstrapRegisterBootstrapAgentParams struct {
// Body.
Body BootstrapRegisterBootstrapAgentBody
// TemplateToken.
TemplateToken string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the bootstrap register bootstrap agent params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapRegisterBootstrapAgentParams) WithDefaults() *BootstrapRegisterBootstrapAgentParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the bootstrap register bootstrap agent params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapRegisterBootstrapAgentParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the bootstrap register bootstrap agent params
func (o *BootstrapRegisterBootstrapAgentParams) WithTimeout(timeout time.Duration) *BootstrapRegisterBootstrapAgentParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the bootstrap register bootstrap agent params
func (o *BootstrapRegisterBootstrapAgentParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the bootstrap register bootstrap agent params
func (o *BootstrapRegisterBootstrapAgentParams) WithContext(ctx context.Context) *BootstrapRegisterBootstrapAgentParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the bootstrap register bootstrap agent params
func (o *BootstrapRegisterBootstrapAgentParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the bootstrap register bootstrap agent params
func (o *BootstrapRegisterBootstrapAgentParams) WithHTTPClient(client *http.Client) *BootstrapRegisterBootstrapAgentParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the bootstrap register bootstrap agent params
func (o *BootstrapRegisterBootstrapAgentParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the bootstrap register bootstrap agent params
func (o *BootstrapRegisterBootstrapAgentParams) WithBody(body BootstrapRegisterBootstrapAgentBody) *BootstrapRegisterBootstrapAgentParams {
o.SetBody(body)
return o
}
// SetBody adds the body to the bootstrap register bootstrap agent params
func (o *BootstrapRegisterBootstrapAgentParams) SetBody(body BootstrapRegisterBootstrapAgentBody) {
o.Body = body
}
// WithTemplateToken adds the templateToken to the bootstrap register bootstrap agent params
func (o *BootstrapRegisterBootstrapAgentParams) WithTemplateToken(templateToken string) *BootstrapRegisterBootstrapAgentParams {
o.SetTemplateToken(templateToken)
return o
}
// SetTemplateToken adds the templateToken to the bootstrap register bootstrap agent params
func (o *BootstrapRegisterBootstrapAgentParams) SetTemplateToken(templateToken string) {
o.TemplateToken = templateToken
}
// WriteToRequest writes these params to a swagger request
func (o *BootstrapRegisterBootstrapAgentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if err := r.SetBodyParam(o.Body); err != nil {
return err
}
// path param templateToken
if err := r.SetPathParam("templateToken", o.TemplateToken); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,275 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/models"
)
// BootstrapRegisterBootstrapAgentReader is a Reader for the BootstrapRegisterBootstrapAgent structure.
type BootstrapRegisterBootstrapAgentReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *BootstrapRegisterBootstrapAgentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewBootstrapRegisterBootstrapAgentOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewBootstrapRegisterBootstrapAgentForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewBootstrapRegisterBootstrapAgentNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewBootstrapRegisterBootstrapAgentInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewBootstrapRegisterBootstrapAgentDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewBootstrapRegisterBootstrapAgentOK creates a BootstrapRegisterBootstrapAgentOK with default headers values
func NewBootstrapRegisterBootstrapAgentOK() *BootstrapRegisterBootstrapAgentOK {
return &BootstrapRegisterBootstrapAgentOK{}
}
/* BootstrapRegisterBootstrapAgentOK describes a response with status code 200, with default header values.
A successful response.
*/
type BootstrapRegisterBootstrapAgentOK struct {
Payload *models.RPCRegisterAgentResponse
}
func (o *BootstrapRegisterBootstrapAgentOK) Error() string {
return fmt.Sprintf("[POST /v2/sentry/bootstrap/{templateToken}/register][%d] bootstrapRegisterBootstrapAgentOK %+v", 200, o.Payload)
}
func (o *BootstrapRegisterBootstrapAgentOK) GetPayload() *models.RPCRegisterAgentResponse {
return o.Payload
}
func (o *BootstrapRegisterBootstrapAgentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.RPCRegisterAgentResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapRegisterBootstrapAgentForbidden creates a BootstrapRegisterBootstrapAgentForbidden with default headers values
func NewBootstrapRegisterBootstrapAgentForbidden() *BootstrapRegisterBootstrapAgentForbidden {
return &BootstrapRegisterBootstrapAgentForbidden{}
}
/* BootstrapRegisterBootstrapAgentForbidden describes a response with status code 403, with default header values.
Returned when the user does not have permission to access the resource.
*/
type BootstrapRegisterBootstrapAgentForbidden struct {
Payload interface{}
}
func (o *BootstrapRegisterBootstrapAgentForbidden) Error() string {
return fmt.Sprintf("[POST /v2/sentry/bootstrap/{templateToken}/register][%d] bootstrapRegisterBootstrapAgentForbidden %+v", 403, o.Payload)
}
func (o *BootstrapRegisterBootstrapAgentForbidden) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapRegisterBootstrapAgentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapRegisterBootstrapAgentNotFound creates a BootstrapRegisterBootstrapAgentNotFound with default headers values
func NewBootstrapRegisterBootstrapAgentNotFound() *BootstrapRegisterBootstrapAgentNotFound {
return &BootstrapRegisterBootstrapAgentNotFound{}
}
/* BootstrapRegisterBootstrapAgentNotFound describes a response with status code 404, with default header values.
Returned when the resource does not exist.
*/
type BootstrapRegisterBootstrapAgentNotFound struct {
Payload interface{}
}
func (o *BootstrapRegisterBootstrapAgentNotFound) Error() string {
return fmt.Sprintf("[POST /v2/sentry/bootstrap/{templateToken}/register][%d] bootstrapRegisterBootstrapAgentNotFound %+v", 404, o.Payload)
}
func (o *BootstrapRegisterBootstrapAgentNotFound) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapRegisterBootstrapAgentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapRegisterBootstrapAgentInternalServerError creates a BootstrapRegisterBootstrapAgentInternalServerError with default headers values
func NewBootstrapRegisterBootstrapAgentInternalServerError() *BootstrapRegisterBootstrapAgentInternalServerError {
return &BootstrapRegisterBootstrapAgentInternalServerError{}
}
/* BootstrapRegisterBootstrapAgentInternalServerError describes a response with status code 500, with default header values.
Returned for internal server error
*/
type BootstrapRegisterBootstrapAgentInternalServerError struct {
Payload interface{}
}
func (o *BootstrapRegisterBootstrapAgentInternalServerError) Error() string {
return fmt.Sprintf("[POST /v2/sentry/bootstrap/{templateToken}/register][%d] bootstrapRegisterBootstrapAgentInternalServerError %+v", 500, o.Payload)
}
func (o *BootstrapRegisterBootstrapAgentInternalServerError) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapRegisterBootstrapAgentInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapRegisterBootstrapAgentDefault creates a BootstrapRegisterBootstrapAgentDefault with default headers values
func NewBootstrapRegisterBootstrapAgentDefault(code int) *BootstrapRegisterBootstrapAgentDefault {
return &BootstrapRegisterBootstrapAgentDefault{
_statusCode: code,
}
}
/* BootstrapRegisterBootstrapAgentDefault describes a response with status code -1, with default header values.
An unexpected error response.
*/
type BootstrapRegisterBootstrapAgentDefault struct {
_statusCode int
Payload *models.GooglerpcStatus
}
// Code gets the status code for the bootstrap register bootstrap agent default response
func (o *BootstrapRegisterBootstrapAgentDefault) Code() int {
return o._statusCode
}
func (o *BootstrapRegisterBootstrapAgentDefault) Error() string {
return fmt.Sprintf("[POST /v2/sentry/bootstrap/{templateToken}/register][%d] Bootstrap_RegisterBootstrapAgent default %+v", o._statusCode, o.Payload)
}
func (o *BootstrapRegisterBootstrapAgentDefault) GetPayload() *models.GooglerpcStatus {
return o.Payload
}
func (o *BootstrapRegisterBootstrapAgentDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.GooglerpcStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
/*BootstrapRegisterBootstrapAgentBody bootstrap register bootstrap agent body
swagger:model BootstrapRegisterBootstrapAgentBody
*/
type BootstrapRegisterBootstrapAgentBody struct {
// csr
// Format: byte
Csr strfmt.Base64 `json:"csr,omitempty"`
// ip address
IPAddress string `json:"ipAddress,omitempty"`
// name
Name string `json:"name,omitempty"`
// template name
TemplateName string `json:"templateName,omitempty"`
// token
Token string `json:"token,omitempty"`
}
// Validate validates this bootstrap register bootstrap agent body
func (o *BootstrapRegisterBootstrapAgentBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this bootstrap register bootstrap agent body based on context it is used
func (o *BootstrapRegisterBootstrapAgentBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *BootstrapRegisterBootstrapAgentBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *BootstrapRegisterBootstrapAgentBody) UnmarshalBinary(b []byte) error {
var res BootstrapRegisterBootstrapAgentBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}

View File

@@ -0,0 +1,189 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/models"
)
// NewBootstrapUpdateBootstrapAgentParams creates a new BootstrapUpdateBootstrapAgentParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewBootstrapUpdateBootstrapAgentParams() *BootstrapUpdateBootstrapAgentParams {
return &BootstrapUpdateBootstrapAgentParams{
timeout: cr.DefaultTimeout,
}
}
// NewBootstrapUpdateBootstrapAgentParamsWithTimeout creates a new BootstrapUpdateBootstrapAgentParams object
// with the ability to set a timeout on a request.
func NewBootstrapUpdateBootstrapAgentParamsWithTimeout(timeout time.Duration) *BootstrapUpdateBootstrapAgentParams {
return &BootstrapUpdateBootstrapAgentParams{
timeout: timeout,
}
}
// NewBootstrapUpdateBootstrapAgentParamsWithContext creates a new BootstrapUpdateBootstrapAgentParams object
// with the ability to set a context for a request.
func NewBootstrapUpdateBootstrapAgentParamsWithContext(ctx context.Context) *BootstrapUpdateBootstrapAgentParams {
return &BootstrapUpdateBootstrapAgentParams{
Context: ctx,
}
}
// NewBootstrapUpdateBootstrapAgentParamsWithHTTPClient creates a new BootstrapUpdateBootstrapAgentParams object
// with the ability to set a custom HTTPClient for a request.
func NewBootstrapUpdateBootstrapAgentParamsWithHTTPClient(client *http.Client) *BootstrapUpdateBootstrapAgentParams {
return &BootstrapUpdateBootstrapAgentParams{
HTTPClient: client,
}
}
/* BootstrapUpdateBootstrapAgentParams contains all the parameters to send to the API endpoint
for the bootstrap update bootstrap agent operation.
Typically these are written to a http.Request.
*/
type BootstrapUpdateBootstrapAgentParams struct {
// Body.
Body *models.SentryBootstrapAgent
/* MetadataName.
name of the resource
*/
MetadataName string
// SpecTemplateRef.
SpecTemplateRef string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the bootstrap update bootstrap agent params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapUpdateBootstrapAgentParams) WithDefaults() *BootstrapUpdateBootstrapAgentParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the bootstrap update bootstrap agent params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapUpdateBootstrapAgentParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the bootstrap update bootstrap agent params
func (o *BootstrapUpdateBootstrapAgentParams) WithTimeout(timeout time.Duration) *BootstrapUpdateBootstrapAgentParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the bootstrap update bootstrap agent params
func (o *BootstrapUpdateBootstrapAgentParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the bootstrap update bootstrap agent params
func (o *BootstrapUpdateBootstrapAgentParams) WithContext(ctx context.Context) *BootstrapUpdateBootstrapAgentParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the bootstrap update bootstrap agent params
func (o *BootstrapUpdateBootstrapAgentParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the bootstrap update bootstrap agent params
func (o *BootstrapUpdateBootstrapAgentParams) WithHTTPClient(client *http.Client) *BootstrapUpdateBootstrapAgentParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the bootstrap update bootstrap agent params
func (o *BootstrapUpdateBootstrapAgentParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the bootstrap update bootstrap agent params
func (o *BootstrapUpdateBootstrapAgentParams) WithBody(body *models.SentryBootstrapAgent) *BootstrapUpdateBootstrapAgentParams {
o.SetBody(body)
return o
}
// SetBody adds the body to the bootstrap update bootstrap agent params
func (o *BootstrapUpdateBootstrapAgentParams) SetBody(body *models.SentryBootstrapAgent) {
o.Body = body
}
// WithMetadataName adds the metadataName to the bootstrap update bootstrap agent params
func (o *BootstrapUpdateBootstrapAgentParams) WithMetadataName(metadataName string) *BootstrapUpdateBootstrapAgentParams {
o.SetMetadataName(metadataName)
return o
}
// SetMetadataName adds the metadataName to the bootstrap update bootstrap agent params
func (o *BootstrapUpdateBootstrapAgentParams) SetMetadataName(metadataName string) {
o.MetadataName = metadataName
}
// WithSpecTemplateRef adds the specTemplateRef to the bootstrap update bootstrap agent params
func (o *BootstrapUpdateBootstrapAgentParams) WithSpecTemplateRef(specTemplateRef string) *BootstrapUpdateBootstrapAgentParams {
o.SetSpecTemplateRef(specTemplateRef)
return o
}
// SetSpecTemplateRef adds the specTemplateRef to the bootstrap update bootstrap agent params
func (o *BootstrapUpdateBootstrapAgentParams) SetSpecTemplateRef(specTemplateRef string) {
o.SpecTemplateRef = specTemplateRef
}
// WriteToRequest writes these params to a swagger request
func (o *BootstrapUpdateBootstrapAgentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Body != nil {
if err := r.SetBodyParam(o.Body); err != nil {
return err
}
}
// path param metadata.name
if err := r.SetPathParam("metadata.name", o.MetadataName); err != nil {
return err
}
// path param spec.templateRef
if err := r.SetPathParam("spec.templateRef", o.SpecTemplateRef); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,223 @@
// Code generated by go-swagger; DO NOT EDIT.
package bootstrap
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/models"
)
// BootstrapUpdateBootstrapAgentReader is a Reader for the BootstrapUpdateBootstrapAgent structure.
type BootstrapUpdateBootstrapAgentReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *BootstrapUpdateBootstrapAgentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewBootstrapUpdateBootstrapAgentOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewBootstrapUpdateBootstrapAgentForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewBootstrapUpdateBootstrapAgentNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewBootstrapUpdateBootstrapAgentInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewBootstrapUpdateBootstrapAgentDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewBootstrapUpdateBootstrapAgentOK creates a BootstrapUpdateBootstrapAgentOK with default headers values
func NewBootstrapUpdateBootstrapAgentOK() *BootstrapUpdateBootstrapAgentOK {
return &BootstrapUpdateBootstrapAgentOK{}
}
/* BootstrapUpdateBootstrapAgentOK describes a response with status code 200, with default header values.
A successful response.
*/
type BootstrapUpdateBootstrapAgentOK struct {
Payload *models.SentryBootstrapAgent
}
func (o *BootstrapUpdateBootstrapAgentOK) Error() string {
return fmt.Sprintf("[PUT /v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}][%d] bootstrapUpdateBootstrapAgentOK %+v", 200, o.Payload)
}
func (o *BootstrapUpdateBootstrapAgentOK) GetPayload() *models.SentryBootstrapAgent {
return o.Payload
}
func (o *BootstrapUpdateBootstrapAgentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.SentryBootstrapAgent)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapUpdateBootstrapAgentForbidden creates a BootstrapUpdateBootstrapAgentForbidden with default headers values
func NewBootstrapUpdateBootstrapAgentForbidden() *BootstrapUpdateBootstrapAgentForbidden {
return &BootstrapUpdateBootstrapAgentForbidden{}
}
/* BootstrapUpdateBootstrapAgentForbidden describes a response with status code 403, with default header values.
Returned when the user does not have permission to access the resource.
*/
type BootstrapUpdateBootstrapAgentForbidden struct {
Payload interface{}
}
func (o *BootstrapUpdateBootstrapAgentForbidden) Error() string {
return fmt.Sprintf("[PUT /v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}][%d] bootstrapUpdateBootstrapAgentForbidden %+v", 403, o.Payload)
}
func (o *BootstrapUpdateBootstrapAgentForbidden) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapUpdateBootstrapAgentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapUpdateBootstrapAgentNotFound creates a BootstrapUpdateBootstrapAgentNotFound with default headers values
func NewBootstrapUpdateBootstrapAgentNotFound() *BootstrapUpdateBootstrapAgentNotFound {
return &BootstrapUpdateBootstrapAgentNotFound{}
}
/* BootstrapUpdateBootstrapAgentNotFound describes a response with status code 404, with default header values.
Returned when the resource does not exist.
*/
type BootstrapUpdateBootstrapAgentNotFound struct {
Payload interface{}
}
func (o *BootstrapUpdateBootstrapAgentNotFound) Error() string {
return fmt.Sprintf("[PUT /v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}][%d] bootstrapUpdateBootstrapAgentNotFound %+v", 404, o.Payload)
}
func (o *BootstrapUpdateBootstrapAgentNotFound) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapUpdateBootstrapAgentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapUpdateBootstrapAgentInternalServerError creates a BootstrapUpdateBootstrapAgentInternalServerError with default headers values
func NewBootstrapUpdateBootstrapAgentInternalServerError() *BootstrapUpdateBootstrapAgentInternalServerError {
return &BootstrapUpdateBootstrapAgentInternalServerError{}
}
/* BootstrapUpdateBootstrapAgentInternalServerError describes a response with status code 500, with default header values.
Returned for internal server error
*/
type BootstrapUpdateBootstrapAgentInternalServerError struct {
Payload interface{}
}
func (o *BootstrapUpdateBootstrapAgentInternalServerError) Error() string {
return fmt.Sprintf("[PUT /v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}][%d] bootstrapUpdateBootstrapAgentInternalServerError %+v", 500, o.Payload)
}
func (o *BootstrapUpdateBootstrapAgentInternalServerError) GetPayload() interface{} {
return o.Payload
}
func (o *BootstrapUpdateBootstrapAgentInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewBootstrapUpdateBootstrapAgentDefault creates a BootstrapUpdateBootstrapAgentDefault with default headers values
func NewBootstrapUpdateBootstrapAgentDefault(code int) *BootstrapUpdateBootstrapAgentDefault {
return &BootstrapUpdateBootstrapAgentDefault{
_statusCode: code,
}
}
/* BootstrapUpdateBootstrapAgentDefault describes a response with status code -1, with default header values.
An unexpected error response.
*/
type BootstrapUpdateBootstrapAgentDefault struct {
_statusCode int
Payload *models.GooglerpcStatus
}
// Code gets the status code for the bootstrap update bootstrap agent default response
func (o *BootstrapUpdateBootstrapAgentDefault) Code() int {
return o._statusCode
}
func (o *BootstrapUpdateBootstrapAgentDefault) Error() string {
return fmt.Sprintf("[PUT /v2/sentry/bootstrap/{spec.templateRef}/agent/{metadata.name}][%d] Bootstrap_UpdateBootstrapAgent default %+v", o._statusCode, o.Payload)
}
func (o *BootstrapUpdateBootstrapAgentDefault) GetPayload() *models.GooglerpcStatus {
return o.Payload
}
func (o *BootstrapUpdateBootstrapAgentDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.GooglerpcStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@@ -0,0 +1,77 @@
// Code generated by go-swagger; DO NOT EDIT.
package cluster_authorization
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// New creates a new cluster authorization API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for cluster authorization API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
ClusterAuthorizationGetUserAuthorization(params *ClusterAuthorizationGetUserAuthorizationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ClusterAuthorizationGetUserAuthorizationOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
ClusterAuthorizationGetUserAuthorization cluster authorization get user authorization API
*/
func (a *Client) ClusterAuthorizationGetUserAuthorization(params *ClusterAuthorizationGetUserAuthorizationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ClusterAuthorizationGetUserAuthorizationOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewClusterAuthorizationGetUserAuthorizationParams()
}
op := &runtime.ClientOperation{
ID: "ClusterAuthorization_GetUserAuthorization",
Method: "GET",
PathPattern: "/v2/sentry/authorization/user",
ProducesMediaTypes: []string{"application/json", "application/yaml"},
ConsumesMediaTypes: []string{"application/json", "application/yaml"},
Schemes: []string{"https"},
Params: params,
Reader: &ClusterAuthorizationGetUserAuthorizationReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*ClusterAuthorizationGetUserAuthorizationOK)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*ClusterAuthorizationGetUserAuthorizationDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}
// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
a.transport = transport
}

View File

@@ -0,0 +1,222 @@
// Code generated by go-swagger; DO NOT EDIT.
package cluster_authorization
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewClusterAuthorizationGetUserAuthorizationParams creates a new ClusterAuthorizationGetUserAuthorizationParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewClusterAuthorizationGetUserAuthorizationParams() *ClusterAuthorizationGetUserAuthorizationParams {
return &ClusterAuthorizationGetUserAuthorizationParams{
timeout: cr.DefaultTimeout,
}
}
// NewClusterAuthorizationGetUserAuthorizationParamsWithTimeout creates a new ClusterAuthorizationGetUserAuthorizationParams object
// with the ability to set a timeout on a request.
func NewClusterAuthorizationGetUserAuthorizationParamsWithTimeout(timeout time.Duration) *ClusterAuthorizationGetUserAuthorizationParams {
return &ClusterAuthorizationGetUserAuthorizationParams{
timeout: timeout,
}
}
// NewClusterAuthorizationGetUserAuthorizationParamsWithContext creates a new ClusterAuthorizationGetUserAuthorizationParams object
// with the ability to set a context for a request.
func NewClusterAuthorizationGetUserAuthorizationParamsWithContext(ctx context.Context) *ClusterAuthorizationGetUserAuthorizationParams {
return &ClusterAuthorizationGetUserAuthorizationParams{
Context: ctx,
}
}
// NewClusterAuthorizationGetUserAuthorizationParamsWithHTTPClient creates a new ClusterAuthorizationGetUserAuthorizationParams object
// with the ability to set a custom HTTPClient for a request.
func NewClusterAuthorizationGetUserAuthorizationParamsWithHTTPClient(client *http.Client) *ClusterAuthorizationGetUserAuthorizationParams {
return &ClusterAuthorizationGetUserAuthorizationParams{
HTTPClient: client,
}
}
/* ClusterAuthorizationGetUserAuthorizationParams contains all the parameters to send to the API endpoint
for the cluster authorization get user authorization operation.
Typically these are written to a http.Request.
*/
type ClusterAuthorizationGetUserAuthorizationParams struct {
// CertIssueSeconds.
//
// Format: int64
CertIssueSeconds *string
// ClusterID.
ClusterID *string
// UserCN.
UserCN *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the cluster authorization get user authorization params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *ClusterAuthorizationGetUserAuthorizationParams) WithDefaults() *ClusterAuthorizationGetUserAuthorizationParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the cluster authorization get user authorization params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *ClusterAuthorizationGetUserAuthorizationParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) WithTimeout(timeout time.Duration) *ClusterAuthorizationGetUserAuthorizationParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) WithContext(ctx context.Context) *ClusterAuthorizationGetUserAuthorizationParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) WithHTTPClient(client *http.Client) *ClusterAuthorizationGetUserAuthorizationParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithCertIssueSeconds adds the certIssueSeconds to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) WithCertIssueSeconds(certIssueSeconds *string) *ClusterAuthorizationGetUserAuthorizationParams {
o.SetCertIssueSeconds(certIssueSeconds)
return o
}
// SetCertIssueSeconds adds the certIssueSeconds to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) SetCertIssueSeconds(certIssueSeconds *string) {
o.CertIssueSeconds = certIssueSeconds
}
// WithClusterID adds the clusterID to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) WithClusterID(clusterID *string) *ClusterAuthorizationGetUserAuthorizationParams {
o.SetClusterID(clusterID)
return o
}
// SetClusterID adds the clusterId to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) SetClusterID(clusterID *string) {
o.ClusterID = clusterID
}
// WithUserCN adds the userCN to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) WithUserCN(userCN *string) *ClusterAuthorizationGetUserAuthorizationParams {
o.SetUserCN(userCN)
return o
}
// SetUserCN adds the userCN to the cluster authorization get user authorization params
func (o *ClusterAuthorizationGetUserAuthorizationParams) SetUserCN(userCN *string) {
o.UserCN = userCN
}
// WriteToRequest writes these params to a swagger request
func (o *ClusterAuthorizationGetUserAuthorizationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.CertIssueSeconds != nil {
// query param certIssueSeconds
var qrCertIssueSeconds string
if o.CertIssueSeconds != nil {
qrCertIssueSeconds = *o.CertIssueSeconds
}
qCertIssueSeconds := qrCertIssueSeconds
if qCertIssueSeconds != "" {
if err := r.SetQueryParam("certIssueSeconds", qCertIssueSeconds); err != nil {
return err
}
}
}
if o.ClusterID != nil {
// query param clusterID
var qrClusterID string
if o.ClusterID != nil {
qrClusterID = *o.ClusterID
}
qClusterID := qrClusterID
if qClusterID != "" {
if err := r.SetQueryParam("clusterID", qClusterID); err != nil {
return err
}
}
}
if o.UserCN != nil {
// query param userCN
var qrUserCN string
if o.UserCN != nil {
qrUserCN = *o.UserCN
}
qUserCN := qrUserCN
if qUserCN != "" {
if err := r.SetQueryParam("userCN", qUserCN); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,187 @@
// Code generated by go-swagger; DO NOT EDIT.
package cluster_authorization
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/models"
)
// ClusterAuthorizationGetUserAuthorizationReader is a Reader for the ClusterAuthorizationGetUserAuthorization structure.
type ClusterAuthorizationGetUserAuthorizationReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *ClusterAuthorizationGetUserAuthorizationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewClusterAuthorizationGetUserAuthorizationOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewClusterAuthorizationGetUserAuthorizationForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewClusterAuthorizationGetUserAuthorizationNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewClusterAuthorizationGetUserAuthorizationDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewClusterAuthorizationGetUserAuthorizationOK creates a ClusterAuthorizationGetUserAuthorizationOK with default headers values
func NewClusterAuthorizationGetUserAuthorizationOK() *ClusterAuthorizationGetUserAuthorizationOK {
return &ClusterAuthorizationGetUserAuthorizationOK{}
}
/* ClusterAuthorizationGetUserAuthorizationOK describes a response with status code 200, with default header values.
A successful response.
*/
type ClusterAuthorizationGetUserAuthorizationOK struct {
Payload *models.RPCGetUserAuthorizationResponse
}
func (o *ClusterAuthorizationGetUserAuthorizationOK) Error() string {
return fmt.Sprintf("[GET /v2/sentry/authorization/user][%d] clusterAuthorizationGetUserAuthorizationOK %+v", 200, o.Payload)
}
func (o *ClusterAuthorizationGetUserAuthorizationOK) GetPayload() *models.RPCGetUserAuthorizationResponse {
return o.Payload
}
func (o *ClusterAuthorizationGetUserAuthorizationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.RPCGetUserAuthorizationResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewClusterAuthorizationGetUserAuthorizationForbidden creates a ClusterAuthorizationGetUserAuthorizationForbidden with default headers values
func NewClusterAuthorizationGetUserAuthorizationForbidden() *ClusterAuthorizationGetUserAuthorizationForbidden {
return &ClusterAuthorizationGetUserAuthorizationForbidden{}
}
/* ClusterAuthorizationGetUserAuthorizationForbidden describes a response with status code 403, with default header values.
Returned when the user does not have permission to access the resource.
*/
type ClusterAuthorizationGetUserAuthorizationForbidden struct {
Payload interface{}
}
func (o *ClusterAuthorizationGetUserAuthorizationForbidden) Error() string {
return fmt.Sprintf("[GET /v2/sentry/authorization/user][%d] clusterAuthorizationGetUserAuthorizationForbidden %+v", 403, o.Payload)
}
func (o *ClusterAuthorizationGetUserAuthorizationForbidden) GetPayload() interface{} {
return o.Payload
}
func (o *ClusterAuthorizationGetUserAuthorizationForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewClusterAuthorizationGetUserAuthorizationNotFound creates a ClusterAuthorizationGetUserAuthorizationNotFound with default headers values
func NewClusterAuthorizationGetUserAuthorizationNotFound() *ClusterAuthorizationGetUserAuthorizationNotFound {
return &ClusterAuthorizationGetUserAuthorizationNotFound{}
}
/* ClusterAuthorizationGetUserAuthorizationNotFound describes a response with status code 404, with default header values.
Returned when the resource does not exist.
*/
type ClusterAuthorizationGetUserAuthorizationNotFound struct {
Payload string
}
func (o *ClusterAuthorizationGetUserAuthorizationNotFound) Error() string {
return fmt.Sprintf("[GET /v2/sentry/authorization/user][%d] clusterAuthorizationGetUserAuthorizationNotFound %+v", 404, o.Payload)
}
func (o *ClusterAuthorizationGetUserAuthorizationNotFound) GetPayload() string {
return o.Payload
}
func (o *ClusterAuthorizationGetUserAuthorizationNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewClusterAuthorizationGetUserAuthorizationDefault creates a ClusterAuthorizationGetUserAuthorizationDefault with default headers values
func NewClusterAuthorizationGetUserAuthorizationDefault(code int) *ClusterAuthorizationGetUserAuthorizationDefault {
return &ClusterAuthorizationGetUserAuthorizationDefault{
_statusCode: code,
}
}
/* ClusterAuthorizationGetUserAuthorizationDefault describes a response with status code -1, with default header values.
An unexpected error response.
*/
type ClusterAuthorizationGetUserAuthorizationDefault struct {
_statusCode int
Payload *models.GooglerpcStatus
}
// Code gets the status code for the cluster authorization get user authorization default response
func (o *ClusterAuthorizationGetUserAuthorizationDefault) Code() int {
return o._statusCode
}
func (o *ClusterAuthorizationGetUserAuthorizationDefault) Error() string {
return fmt.Sprintf("[GET /v2/sentry/authorization/user][%d] ClusterAuthorization_GetUserAuthorization default %+v", o._statusCode, o.Payload)
}
func (o *ClusterAuthorizationGetUserAuthorizationDefault) GetPayload() *models.GooglerpcStatus {
return o.Payload
}
func (o *ClusterAuthorizationGetUserAuthorizationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.GooglerpcStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@@ -0,0 +1,117 @@
// Code generated by go-swagger; DO NOT EDIT.
package kubectl_cluster_settings
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// New creates a new kubectl cluster settings API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for kubectl cluster settings API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
KubectlClusterSettingsGetKubectlClusterSettings(params *KubectlClusterSettingsGetKubectlClusterSettingsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*KubectlClusterSettingsGetKubectlClusterSettingsOK, error)
KubectlClusterSettingsUpdateKubectlClusterSettings(params *KubectlClusterSettingsUpdateKubectlClusterSettingsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*KubectlClusterSettingsUpdateKubectlClusterSettingsOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
KubectlClusterSettingsGetKubectlClusterSettings kubectl cluster settings get kubectl cluster settings API
*/
func (a *Client) KubectlClusterSettingsGetKubectlClusterSettings(params *KubectlClusterSettingsGetKubectlClusterSettingsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*KubectlClusterSettingsGetKubectlClusterSettingsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewKubectlClusterSettingsGetKubectlClusterSettingsParams()
}
op := &runtime.ClientOperation{
ID: "KubectlClusterSettings_GetKubectlClusterSettings",
Method: "GET",
PathPattern: "/v2/sentry/kubectl/{opts.urlScope}/settings",
ProducesMediaTypes: []string{"application/json", "application/yaml"},
ConsumesMediaTypes: []string{"application/json", "application/yaml"},
Schemes: []string{"https"},
Params: params,
Reader: &KubectlClusterSettingsGetKubectlClusterSettingsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*KubectlClusterSettingsGetKubectlClusterSettingsOK)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*KubectlClusterSettingsGetKubectlClusterSettingsDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}
/*
KubectlClusterSettingsUpdateKubectlClusterSettings kubectl cluster settings update kubectl cluster settings API
*/
func (a *Client) KubectlClusterSettingsUpdateKubectlClusterSettings(params *KubectlClusterSettingsUpdateKubectlClusterSettingsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*KubectlClusterSettingsUpdateKubectlClusterSettingsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewKubectlClusterSettingsUpdateKubectlClusterSettingsParams()
}
op := &runtime.ClientOperation{
ID: "KubectlClusterSettings_UpdateKubectlClusterSettings",
Method: "PUT",
PathPattern: "/v2/sentry/kubectl/{opts.urlScope}/settings",
ProducesMediaTypes: []string{"application/json", "application/yaml"},
ConsumesMediaTypes: []string{"application/json", "application/yaml"},
Schemes: []string{"https"},
Params: params,
Reader: &KubectlClusterSettingsUpdateKubectlClusterSettingsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*KubectlClusterSettingsUpdateKubectlClusterSettingsOK)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*KubectlClusterSettingsUpdateKubectlClusterSettingsDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}
// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
a.transport = transport
}

View File

@@ -0,0 +1,897 @@
// Code generated by go-swagger; DO NOT EDIT.
package kubectl_cluster_settings
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// NewKubectlClusterSettingsGetKubectlClusterSettingsParams creates a new KubectlClusterSettingsGetKubectlClusterSettingsParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewKubectlClusterSettingsGetKubectlClusterSettingsParams() *KubectlClusterSettingsGetKubectlClusterSettingsParams {
return &KubectlClusterSettingsGetKubectlClusterSettingsParams{
timeout: cr.DefaultTimeout,
}
}
// NewKubectlClusterSettingsGetKubectlClusterSettingsParamsWithTimeout creates a new KubectlClusterSettingsGetKubectlClusterSettingsParams object
// with the ability to set a timeout on a request.
func NewKubectlClusterSettingsGetKubectlClusterSettingsParamsWithTimeout(timeout time.Duration) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
return &KubectlClusterSettingsGetKubectlClusterSettingsParams{
timeout: timeout,
}
}
// NewKubectlClusterSettingsGetKubectlClusterSettingsParamsWithContext creates a new KubectlClusterSettingsGetKubectlClusterSettingsParams object
// with the ability to set a context for a request.
func NewKubectlClusterSettingsGetKubectlClusterSettingsParamsWithContext(ctx context.Context) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
return &KubectlClusterSettingsGetKubectlClusterSettingsParams{
Context: ctx,
}
}
// NewKubectlClusterSettingsGetKubectlClusterSettingsParamsWithHTTPClient creates a new KubectlClusterSettingsGetKubectlClusterSettingsParams object
// with the ability to set a custom HTTPClient for a request.
func NewKubectlClusterSettingsGetKubectlClusterSettingsParamsWithHTTPClient(client *http.Client) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
return &KubectlClusterSettingsGetKubectlClusterSettingsParams{
HTTPClient: client,
}
}
/* KubectlClusterSettingsGetKubectlClusterSettingsParams contains all the parameters to send to the API endpoint
for the kubectl cluster settings get kubectl cluster settings operation.
Typically these are written to a http.Request.
*/
type KubectlClusterSettingsGetKubectlClusterSettingsParams struct {
// OptsID.
OptsID *string
// OptsAccount.
OptsAccount *string
// OptsBlueprintRef.
OptsBlueprintRef *string
// OptsClusterID.
OptsClusterID *string
// OptsCount.
//
// Format: int64
OptsCount *string
// OptsDeleted.
OptsDeleted *bool
/* OptsDisplayName.
displayName only used for update queries to set displayName (READONLY).
*/
OptsDisplayName *string
// OptsExtended.
OptsExtended *bool
/* OptsGlobalScope.
globalScope sets partnerID,organizationID,projectID = 0.
*/
OptsGlobalScope *bool
// OptsGroups.
OptsGroups []string
/* OptsIgnoreScopeDefault.
ignoreScopeDefault ignores default values for partnerID, organizationID and
projectID.
*/
OptsIgnoreScopeDefault *bool
// OptsIsSSOUser.
OptsIsSSOUser *bool
// OptsLimit.
//
// Format: int64
OptsLimit *string
/* OptsName.
name is unique ID of a resource along with (partnerID, organizationID,
projectID).
*/
OptsName *string
// OptsOffset.
//
// Format: int64
OptsOffset *string
// OptsOrder.
OptsOrder *string
// OptsOrderBy.
OptsOrderBy *string
// OptsOrganization.
OptsOrganization *string
// OptsPartner.
OptsPartner *string
// OptsProject.
OptsProject *string
// OptsPublishedVersion.
OptsPublishedVersion *string
/* OptsSelector.
selector is used to filter the labels of a resource.
*/
OptsSelector *string
/* OptsURLScope.
urlScope is supposed to be passed in the URL as kind/HashID(value)
*/
OptsURLScope string
// OptsUsername.
OptsUsername *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the kubectl cluster settings get kubectl cluster settings params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithDefaults() *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the kubectl cluster settings get kubectl cluster settings params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithTimeout(timeout time.Duration) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithContext(ctx context.Context) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithHTTPClient(client *http.Client) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithOptsID adds the optsID to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsID(optsID *string) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsID(optsID)
return o
}
// SetOptsID adds the optsId to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsID(optsID *string) {
o.OptsID = optsID
}
// WithOptsAccount adds the optsAccount to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsAccount(optsAccount *string) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsAccount(optsAccount)
return o
}
// SetOptsAccount adds the optsAccount to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsAccount(optsAccount *string) {
o.OptsAccount = optsAccount
}
// WithOptsBlueprintRef adds the optsBlueprintRef to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsBlueprintRef(optsBlueprintRef *string) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsBlueprintRef(optsBlueprintRef)
return o
}
// SetOptsBlueprintRef adds the optsBlueprintRef to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsBlueprintRef(optsBlueprintRef *string) {
o.OptsBlueprintRef = optsBlueprintRef
}
// WithOptsClusterID adds the optsClusterID to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsClusterID(optsClusterID *string) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsClusterID(optsClusterID)
return o
}
// SetOptsClusterID adds the optsClusterId to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsClusterID(optsClusterID *string) {
o.OptsClusterID = optsClusterID
}
// WithOptsCount adds the optsCount to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsCount(optsCount *string) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsCount(optsCount)
return o
}
// SetOptsCount adds the optsCount to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsCount(optsCount *string) {
o.OptsCount = optsCount
}
// WithOptsDeleted adds the optsDeleted to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsDeleted(optsDeleted *bool) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsDeleted(optsDeleted)
return o
}
// SetOptsDeleted adds the optsDeleted to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsDeleted(optsDeleted *bool) {
o.OptsDeleted = optsDeleted
}
// WithOptsDisplayName adds the optsDisplayName to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsDisplayName(optsDisplayName *string) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsDisplayName(optsDisplayName)
return o
}
// SetOptsDisplayName adds the optsDisplayName to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsDisplayName(optsDisplayName *string) {
o.OptsDisplayName = optsDisplayName
}
// WithOptsExtended adds the optsExtended to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsExtended(optsExtended *bool) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsExtended(optsExtended)
return o
}
// SetOptsExtended adds the optsExtended to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsExtended(optsExtended *bool) {
o.OptsExtended = optsExtended
}
// WithOptsGlobalScope adds the optsGlobalScope to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsGlobalScope(optsGlobalScope *bool) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsGlobalScope(optsGlobalScope)
return o
}
// SetOptsGlobalScope adds the optsGlobalScope to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsGlobalScope(optsGlobalScope *bool) {
o.OptsGlobalScope = optsGlobalScope
}
// WithOptsGroups adds the optsGroups to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsGroups(optsGroups []string) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsGroups(optsGroups)
return o
}
// SetOptsGroups adds the optsGroups to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsGroups(optsGroups []string) {
o.OptsGroups = optsGroups
}
// WithOptsIgnoreScopeDefault adds the optsIgnoreScopeDefault to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsIgnoreScopeDefault(optsIgnoreScopeDefault *bool) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsIgnoreScopeDefault(optsIgnoreScopeDefault)
return o
}
// SetOptsIgnoreScopeDefault adds the optsIgnoreScopeDefault to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsIgnoreScopeDefault(optsIgnoreScopeDefault *bool) {
o.OptsIgnoreScopeDefault = optsIgnoreScopeDefault
}
// WithOptsIsSSOUser adds the optsIsSSOUser to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsIsSSOUser(optsIsSSOUser *bool) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsIsSSOUser(optsIsSSOUser)
return o
}
// SetOptsIsSSOUser adds the optsIsSSOUser to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsIsSSOUser(optsIsSSOUser *bool) {
o.OptsIsSSOUser = optsIsSSOUser
}
// WithOptsLimit adds the optsLimit to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsLimit(optsLimit *string) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsLimit(optsLimit)
return o
}
// SetOptsLimit adds the optsLimit to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsLimit(optsLimit *string) {
o.OptsLimit = optsLimit
}
// WithOptsName adds the optsName to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsName(optsName *string) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsName(optsName)
return o
}
// SetOptsName adds the optsName to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsName(optsName *string) {
o.OptsName = optsName
}
// WithOptsOffset adds the optsOffset to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsOffset(optsOffset *string) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsOffset(optsOffset)
return o
}
// SetOptsOffset adds the optsOffset to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsOffset(optsOffset *string) {
o.OptsOffset = optsOffset
}
// WithOptsOrder adds the optsOrder to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsOrder(optsOrder *string) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsOrder(optsOrder)
return o
}
// SetOptsOrder adds the optsOrder to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsOrder(optsOrder *string) {
o.OptsOrder = optsOrder
}
// WithOptsOrderBy adds the optsOrderBy to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsOrderBy(optsOrderBy *string) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsOrderBy(optsOrderBy)
return o
}
// SetOptsOrderBy adds the optsOrderBy to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsOrderBy(optsOrderBy *string) {
o.OptsOrderBy = optsOrderBy
}
// WithOptsOrganization adds the optsOrganization to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsOrganization(optsOrganization *string) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsOrganization(optsOrganization)
return o
}
// SetOptsOrganization adds the optsOrganization to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsOrganization(optsOrganization *string) {
o.OptsOrganization = optsOrganization
}
// WithOptsPartner adds the optsPartner to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsPartner(optsPartner *string) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsPartner(optsPartner)
return o
}
// SetOptsPartner adds the optsPartner to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsPartner(optsPartner *string) {
o.OptsPartner = optsPartner
}
// WithOptsProject adds the optsProject to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsProject(optsProject *string) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsProject(optsProject)
return o
}
// SetOptsProject adds the optsProject to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsProject(optsProject *string) {
o.OptsProject = optsProject
}
// WithOptsPublishedVersion adds the optsPublishedVersion to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsPublishedVersion(optsPublishedVersion *string) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsPublishedVersion(optsPublishedVersion)
return o
}
// SetOptsPublishedVersion adds the optsPublishedVersion to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsPublishedVersion(optsPublishedVersion *string) {
o.OptsPublishedVersion = optsPublishedVersion
}
// WithOptsSelector adds the optsSelector to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsSelector(optsSelector *string) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsSelector(optsSelector)
return o
}
// SetOptsSelector adds the optsSelector to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsSelector(optsSelector *string) {
o.OptsSelector = optsSelector
}
// WithOptsURLScope adds the optsURLScope to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsURLScope(optsURLScope string) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsURLScope(optsURLScope)
return o
}
// SetOptsURLScope adds the optsUrlScope to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsURLScope(optsURLScope string) {
o.OptsURLScope = optsURLScope
}
// WithOptsUsername adds the optsUsername to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WithOptsUsername(optsUsername *string) *KubectlClusterSettingsGetKubectlClusterSettingsParams {
o.SetOptsUsername(optsUsername)
return o
}
// SetOptsUsername adds the optsUsername to the kubectl cluster settings get kubectl cluster settings params
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) SetOptsUsername(optsUsername *string) {
o.OptsUsername = optsUsername
}
// WriteToRequest writes these params to a swagger request
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.OptsID != nil {
// query param opts.ID
var qrOptsID string
if o.OptsID != nil {
qrOptsID = *o.OptsID
}
qOptsID := qrOptsID
if qOptsID != "" {
if err := r.SetQueryParam("opts.ID", qOptsID); err != nil {
return err
}
}
}
if o.OptsAccount != nil {
// query param opts.account
var qrOptsAccount string
if o.OptsAccount != nil {
qrOptsAccount = *o.OptsAccount
}
qOptsAccount := qrOptsAccount
if qOptsAccount != "" {
if err := r.SetQueryParam("opts.account", qOptsAccount); err != nil {
return err
}
}
}
if o.OptsBlueprintRef != nil {
// query param opts.blueprintRef
var qrOptsBlueprintRef string
if o.OptsBlueprintRef != nil {
qrOptsBlueprintRef = *o.OptsBlueprintRef
}
qOptsBlueprintRef := qrOptsBlueprintRef
if qOptsBlueprintRef != "" {
if err := r.SetQueryParam("opts.blueprintRef", qOptsBlueprintRef); err != nil {
return err
}
}
}
if o.OptsClusterID != nil {
// query param opts.clusterID
var qrOptsClusterID string
if o.OptsClusterID != nil {
qrOptsClusterID = *o.OptsClusterID
}
qOptsClusterID := qrOptsClusterID
if qOptsClusterID != "" {
if err := r.SetQueryParam("opts.clusterID", qOptsClusterID); err != nil {
return err
}
}
}
if o.OptsCount != nil {
// query param opts.count
var qrOptsCount string
if o.OptsCount != nil {
qrOptsCount = *o.OptsCount
}
qOptsCount := qrOptsCount
if qOptsCount != "" {
if err := r.SetQueryParam("opts.count", qOptsCount); err != nil {
return err
}
}
}
if o.OptsDeleted != nil {
// query param opts.deleted
var qrOptsDeleted bool
if o.OptsDeleted != nil {
qrOptsDeleted = *o.OptsDeleted
}
qOptsDeleted := swag.FormatBool(qrOptsDeleted)
if qOptsDeleted != "" {
if err := r.SetQueryParam("opts.deleted", qOptsDeleted); err != nil {
return err
}
}
}
if o.OptsDisplayName != nil {
// query param opts.displayName
var qrOptsDisplayName string
if o.OptsDisplayName != nil {
qrOptsDisplayName = *o.OptsDisplayName
}
qOptsDisplayName := qrOptsDisplayName
if qOptsDisplayName != "" {
if err := r.SetQueryParam("opts.displayName", qOptsDisplayName); err != nil {
return err
}
}
}
if o.OptsExtended != nil {
// query param opts.extended
var qrOptsExtended bool
if o.OptsExtended != nil {
qrOptsExtended = *o.OptsExtended
}
qOptsExtended := swag.FormatBool(qrOptsExtended)
if qOptsExtended != "" {
if err := r.SetQueryParam("opts.extended", qOptsExtended); err != nil {
return err
}
}
}
if o.OptsGlobalScope != nil {
// query param opts.globalScope
var qrOptsGlobalScope bool
if o.OptsGlobalScope != nil {
qrOptsGlobalScope = *o.OptsGlobalScope
}
qOptsGlobalScope := swag.FormatBool(qrOptsGlobalScope)
if qOptsGlobalScope != "" {
if err := r.SetQueryParam("opts.globalScope", qOptsGlobalScope); err != nil {
return err
}
}
}
if o.OptsGroups != nil {
// binding items for opts.groups
joinedOptsGroups := o.bindParamOptsGroups(reg)
// query array param opts.groups
if err := r.SetQueryParam("opts.groups", joinedOptsGroups...); err != nil {
return err
}
}
if o.OptsIgnoreScopeDefault != nil {
// query param opts.ignoreScopeDefault
var qrOptsIgnoreScopeDefault bool
if o.OptsIgnoreScopeDefault != nil {
qrOptsIgnoreScopeDefault = *o.OptsIgnoreScopeDefault
}
qOptsIgnoreScopeDefault := swag.FormatBool(qrOptsIgnoreScopeDefault)
if qOptsIgnoreScopeDefault != "" {
if err := r.SetQueryParam("opts.ignoreScopeDefault", qOptsIgnoreScopeDefault); err != nil {
return err
}
}
}
if o.OptsIsSSOUser != nil {
// query param opts.isSSOUser
var qrOptsIsSSOUser bool
if o.OptsIsSSOUser != nil {
qrOptsIsSSOUser = *o.OptsIsSSOUser
}
qOptsIsSSOUser := swag.FormatBool(qrOptsIsSSOUser)
if qOptsIsSSOUser != "" {
if err := r.SetQueryParam("opts.isSSOUser", qOptsIsSSOUser); err != nil {
return err
}
}
}
if o.OptsLimit != nil {
// query param opts.limit
var qrOptsLimit string
if o.OptsLimit != nil {
qrOptsLimit = *o.OptsLimit
}
qOptsLimit := qrOptsLimit
if qOptsLimit != "" {
if err := r.SetQueryParam("opts.limit", qOptsLimit); err != nil {
return err
}
}
}
if o.OptsName != nil {
// query param opts.name
var qrOptsName string
if o.OptsName != nil {
qrOptsName = *o.OptsName
}
qOptsName := qrOptsName
if qOptsName != "" {
if err := r.SetQueryParam("opts.name", qOptsName); err != nil {
return err
}
}
}
if o.OptsOffset != nil {
// query param opts.offset
var qrOptsOffset string
if o.OptsOffset != nil {
qrOptsOffset = *o.OptsOffset
}
qOptsOffset := qrOptsOffset
if qOptsOffset != "" {
if err := r.SetQueryParam("opts.offset", qOptsOffset); err != nil {
return err
}
}
}
if o.OptsOrder != nil {
// query param opts.order
var qrOptsOrder string
if o.OptsOrder != nil {
qrOptsOrder = *o.OptsOrder
}
qOptsOrder := qrOptsOrder
if qOptsOrder != "" {
if err := r.SetQueryParam("opts.order", qOptsOrder); err != nil {
return err
}
}
}
if o.OptsOrderBy != nil {
// query param opts.orderBy
var qrOptsOrderBy string
if o.OptsOrderBy != nil {
qrOptsOrderBy = *o.OptsOrderBy
}
qOptsOrderBy := qrOptsOrderBy
if qOptsOrderBy != "" {
if err := r.SetQueryParam("opts.orderBy", qOptsOrderBy); err != nil {
return err
}
}
}
if o.OptsOrganization != nil {
// query param opts.organization
var qrOptsOrganization string
if o.OptsOrganization != nil {
qrOptsOrganization = *o.OptsOrganization
}
qOptsOrganization := qrOptsOrganization
if qOptsOrganization != "" {
if err := r.SetQueryParam("opts.organization", qOptsOrganization); err != nil {
return err
}
}
}
if o.OptsPartner != nil {
// query param opts.partner
var qrOptsPartner string
if o.OptsPartner != nil {
qrOptsPartner = *o.OptsPartner
}
qOptsPartner := qrOptsPartner
if qOptsPartner != "" {
if err := r.SetQueryParam("opts.partner", qOptsPartner); err != nil {
return err
}
}
}
if o.OptsProject != nil {
// query param opts.project
var qrOptsProject string
if o.OptsProject != nil {
qrOptsProject = *o.OptsProject
}
qOptsProject := qrOptsProject
if qOptsProject != "" {
if err := r.SetQueryParam("opts.project", qOptsProject); err != nil {
return err
}
}
}
if o.OptsPublishedVersion != nil {
// query param opts.publishedVersion
var qrOptsPublishedVersion string
if o.OptsPublishedVersion != nil {
qrOptsPublishedVersion = *o.OptsPublishedVersion
}
qOptsPublishedVersion := qrOptsPublishedVersion
if qOptsPublishedVersion != "" {
if err := r.SetQueryParam("opts.publishedVersion", qOptsPublishedVersion); err != nil {
return err
}
}
}
if o.OptsSelector != nil {
// query param opts.selector
var qrOptsSelector string
if o.OptsSelector != nil {
qrOptsSelector = *o.OptsSelector
}
qOptsSelector := qrOptsSelector
if qOptsSelector != "" {
if err := r.SetQueryParam("opts.selector", qOptsSelector); err != nil {
return err
}
}
}
// path param opts.urlScope
if err := r.SetPathParam("opts.urlScope", o.OptsURLScope); err != nil {
return err
}
if o.OptsUsername != nil {
// query param opts.username
var qrOptsUsername string
if o.OptsUsername != nil {
qrOptsUsername = *o.OptsUsername
}
qOptsUsername := qrOptsUsername
if qOptsUsername != "" {
if err := r.SetQueryParam("opts.username", qOptsUsername); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// bindParamKubectlClusterSettingsGetKubectlClusterSettings binds the parameter opts.groups
func (o *KubectlClusterSettingsGetKubectlClusterSettingsParams) bindParamOptsGroups(formats strfmt.Registry) []string {
optsGroupsIR := o.OptsGroups
var optsGroupsIC []string
for _, optsGroupsIIR := range optsGroupsIR { // explode []string
optsGroupsIIV := optsGroupsIIR // string as string
optsGroupsIC = append(optsGroupsIC, optsGroupsIIV)
}
// items.CollectionFormat: "multi"
optsGroupsIS := swag.JoinByFormat(optsGroupsIC, "multi")
return optsGroupsIS
}

View File

@@ -0,0 +1,187 @@
// Code generated by go-swagger; DO NOT EDIT.
package kubectl_cluster_settings
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/models"
)
// KubectlClusterSettingsGetKubectlClusterSettingsReader is a Reader for the KubectlClusterSettingsGetKubectlClusterSettings structure.
type KubectlClusterSettingsGetKubectlClusterSettingsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *KubectlClusterSettingsGetKubectlClusterSettingsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewKubectlClusterSettingsGetKubectlClusterSettingsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewKubectlClusterSettingsGetKubectlClusterSettingsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewKubectlClusterSettingsGetKubectlClusterSettingsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewKubectlClusterSettingsGetKubectlClusterSettingsDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewKubectlClusterSettingsGetKubectlClusterSettingsOK creates a KubectlClusterSettingsGetKubectlClusterSettingsOK with default headers values
func NewKubectlClusterSettingsGetKubectlClusterSettingsOK() *KubectlClusterSettingsGetKubectlClusterSettingsOK {
return &KubectlClusterSettingsGetKubectlClusterSettingsOK{}
}
/* KubectlClusterSettingsGetKubectlClusterSettingsOK describes a response with status code 200, with default header values.
A successful response.
*/
type KubectlClusterSettingsGetKubectlClusterSettingsOK struct {
Payload *models.RPCGetKubectlClusterSettingsResponse
}
func (o *KubectlClusterSettingsGetKubectlClusterSettingsOK) Error() string {
return fmt.Sprintf("[GET /v2/sentry/kubectl/{opts.urlScope}/settings][%d] kubectlClusterSettingsGetKubectlClusterSettingsOK %+v", 200, o.Payload)
}
func (o *KubectlClusterSettingsGetKubectlClusterSettingsOK) GetPayload() *models.RPCGetKubectlClusterSettingsResponse {
return o.Payload
}
func (o *KubectlClusterSettingsGetKubectlClusterSettingsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.RPCGetKubectlClusterSettingsResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewKubectlClusterSettingsGetKubectlClusterSettingsForbidden creates a KubectlClusterSettingsGetKubectlClusterSettingsForbidden with default headers values
func NewKubectlClusterSettingsGetKubectlClusterSettingsForbidden() *KubectlClusterSettingsGetKubectlClusterSettingsForbidden {
return &KubectlClusterSettingsGetKubectlClusterSettingsForbidden{}
}
/* KubectlClusterSettingsGetKubectlClusterSettingsForbidden describes a response with status code 403, with default header values.
Returned when the user does not have permission to access the resource.
*/
type KubectlClusterSettingsGetKubectlClusterSettingsForbidden struct {
Payload interface{}
}
func (o *KubectlClusterSettingsGetKubectlClusterSettingsForbidden) Error() string {
return fmt.Sprintf("[GET /v2/sentry/kubectl/{opts.urlScope}/settings][%d] kubectlClusterSettingsGetKubectlClusterSettingsForbidden %+v", 403, o.Payload)
}
func (o *KubectlClusterSettingsGetKubectlClusterSettingsForbidden) GetPayload() interface{} {
return o.Payload
}
func (o *KubectlClusterSettingsGetKubectlClusterSettingsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewKubectlClusterSettingsGetKubectlClusterSettingsNotFound creates a KubectlClusterSettingsGetKubectlClusterSettingsNotFound with default headers values
func NewKubectlClusterSettingsGetKubectlClusterSettingsNotFound() *KubectlClusterSettingsGetKubectlClusterSettingsNotFound {
return &KubectlClusterSettingsGetKubectlClusterSettingsNotFound{}
}
/* KubectlClusterSettingsGetKubectlClusterSettingsNotFound describes a response with status code 404, with default header values.
Returned when the resource does not exist.
*/
type KubectlClusterSettingsGetKubectlClusterSettingsNotFound struct {
Payload string
}
func (o *KubectlClusterSettingsGetKubectlClusterSettingsNotFound) Error() string {
return fmt.Sprintf("[GET /v2/sentry/kubectl/{opts.urlScope}/settings][%d] kubectlClusterSettingsGetKubectlClusterSettingsNotFound %+v", 404, o.Payload)
}
func (o *KubectlClusterSettingsGetKubectlClusterSettingsNotFound) GetPayload() string {
return o.Payload
}
func (o *KubectlClusterSettingsGetKubectlClusterSettingsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewKubectlClusterSettingsGetKubectlClusterSettingsDefault creates a KubectlClusterSettingsGetKubectlClusterSettingsDefault with default headers values
func NewKubectlClusterSettingsGetKubectlClusterSettingsDefault(code int) *KubectlClusterSettingsGetKubectlClusterSettingsDefault {
return &KubectlClusterSettingsGetKubectlClusterSettingsDefault{
_statusCode: code,
}
}
/* KubectlClusterSettingsGetKubectlClusterSettingsDefault describes a response with status code -1, with default header values.
An unexpected error response.
*/
type KubectlClusterSettingsGetKubectlClusterSettingsDefault struct {
_statusCode int
Payload *models.GooglerpcStatus
}
// Code gets the status code for the kubectl cluster settings get kubectl cluster settings default response
func (o *KubectlClusterSettingsGetKubectlClusterSettingsDefault) Code() int {
return o._statusCode
}
func (o *KubectlClusterSettingsGetKubectlClusterSettingsDefault) Error() string {
return fmt.Sprintf("[GET /v2/sentry/kubectl/{opts.urlScope}/settings][%d] KubectlClusterSettings_GetKubectlClusterSettings default %+v", o._statusCode, o.Payload)
}
func (o *KubectlClusterSettingsGetKubectlClusterSettingsDefault) GetPayload() *models.GooglerpcStatus {
return o.Payload
}
func (o *KubectlClusterSettingsGetKubectlClusterSettingsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.GooglerpcStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@@ -0,0 +1,170 @@
// Code generated by go-swagger; DO NOT EDIT.
package kubectl_cluster_settings
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/models"
)
// NewKubectlClusterSettingsUpdateKubectlClusterSettingsParams creates a new KubectlClusterSettingsUpdateKubectlClusterSettingsParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewKubectlClusterSettingsUpdateKubectlClusterSettingsParams() *KubectlClusterSettingsUpdateKubectlClusterSettingsParams {
return &KubectlClusterSettingsUpdateKubectlClusterSettingsParams{
timeout: cr.DefaultTimeout,
}
}
// NewKubectlClusterSettingsUpdateKubectlClusterSettingsParamsWithTimeout creates a new KubectlClusterSettingsUpdateKubectlClusterSettingsParams object
// with the ability to set a timeout on a request.
func NewKubectlClusterSettingsUpdateKubectlClusterSettingsParamsWithTimeout(timeout time.Duration) *KubectlClusterSettingsUpdateKubectlClusterSettingsParams {
return &KubectlClusterSettingsUpdateKubectlClusterSettingsParams{
timeout: timeout,
}
}
// NewKubectlClusterSettingsUpdateKubectlClusterSettingsParamsWithContext creates a new KubectlClusterSettingsUpdateKubectlClusterSettingsParams object
// with the ability to set a context for a request.
func NewKubectlClusterSettingsUpdateKubectlClusterSettingsParamsWithContext(ctx context.Context) *KubectlClusterSettingsUpdateKubectlClusterSettingsParams {
return &KubectlClusterSettingsUpdateKubectlClusterSettingsParams{
Context: ctx,
}
}
// NewKubectlClusterSettingsUpdateKubectlClusterSettingsParamsWithHTTPClient creates a new KubectlClusterSettingsUpdateKubectlClusterSettingsParams object
// with the ability to set a custom HTTPClient for a request.
func NewKubectlClusterSettingsUpdateKubectlClusterSettingsParamsWithHTTPClient(client *http.Client) *KubectlClusterSettingsUpdateKubectlClusterSettingsParams {
return &KubectlClusterSettingsUpdateKubectlClusterSettingsParams{
HTTPClient: client,
}
}
/* KubectlClusterSettingsUpdateKubectlClusterSettingsParams contains all the parameters to send to the API endpoint
for the kubectl cluster settings update kubectl cluster settings operation.
Typically these are written to a http.Request.
*/
type KubectlClusterSettingsUpdateKubectlClusterSettingsParams struct {
// Body.
Body *models.RPCUpdateKubectlClusterSettingsRequest
/* OptsURLScope.
urlScope is supposed to be passed in the URL as kind/HashID(value)
*/
OptsURLScope string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the kubectl cluster settings update kubectl cluster settings params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsParams) WithDefaults() *KubectlClusterSettingsUpdateKubectlClusterSettingsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the kubectl cluster settings update kubectl cluster settings params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the kubectl cluster settings update kubectl cluster settings params
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsParams) WithTimeout(timeout time.Duration) *KubectlClusterSettingsUpdateKubectlClusterSettingsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the kubectl cluster settings update kubectl cluster settings params
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the kubectl cluster settings update kubectl cluster settings params
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsParams) WithContext(ctx context.Context) *KubectlClusterSettingsUpdateKubectlClusterSettingsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the kubectl cluster settings update kubectl cluster settings params
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the kubectl cluster settings update kubectl cluster settings params
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsParams) WithHTTPClient(client *http.Client) *KubectlClusterSettingsUpdateKubectlClusterSettingsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the kubectl cluster settings update kubectl cluster settings params
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the kubectl cluster settings update kubectl cluster settings params
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsParams) WithBody(body *models.RPCUpdateKubectlClusterSettingsRequest) *KubectlClusterSettingsUpdateKubectlClusterSettingsParams {
o.SetBody(body)
return o
}
// SetBody adds the body to the kubectl cluster settings update kubectl cluster settings params
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsParams) SetBody(body *models.RPCUpdateKubectlClusterSettingsRequest) {
o.Body = body
}
// WithOptsURLScope adds the optsURLScope to the kubectl cluster settings update kubectl cluster settings params
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsParams) WithOptsURLScope(optsURLScope string) *KubectlClusterSettingsUpdateKubectlClusterSettingsParams {
o.SetOptsURLScope(optsURLScope)
return o
}
// SetOptsURLScope adds the optsUrlScope to the kubectl cluster settings update kubectl cluster settings params
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsParams) SetOptsURLScope(optsURLScope string) {
o.OptsURLScope = optsURLScope
}
// WriteToRequest writes these params to a swagger request
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Body != nil {
if err := r.SetBodyParam(o.Body); err != nil {
return err
}
}
// path param opts.urlScope
if err := r.SetPathParam("opts.urlScope", o.OptsURLScope); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,185 @@
// Code generated by go-swagger; DO NOT EDIT.
package kubectl_cluster_settings
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/models"
)
// KubectlClusterSettingsUpdateKubectlClusterSettingsReader is a Reader for the KubectlClusterSettingsUpdateKubectlClusterSettings structure.
type KubectlClusterSettingsUpdateKubectlClusterSettingsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewKubectlClusterSettingsUpdateKubectlClusterSettingsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewKubectlClusterSettingsUpdateKubectlClusterSettingsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewKubectlClusterSettingsUpdateKubectlClusterSettingsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewKubectlClusterSettingsUpdateKubectlClusterSettingsDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewKubectlClusterSettingsUpdateKubectlClusterSettingsOK creates a KubectlClusterSettingsUpdateKubectlClusterSettingsOK with default headers values
func NewKubectlClusterSettingsUpdateKubectlClusterSettingsOK() *KubectlClusterSettingsUpdateKubectlClusterSettingsOK {
return &KubectlClusterSettingsUpdateKubectlClusterSettingsOK{}
}
/* KubectlClusterSettingsUpdateKubectlClusterSettingsOK describes a response with status code 200, with default header values.
A successful response.
*/
type KubectlClusterSettingsUpdateKubectlClusterSettingsOK struct {
Payload models.RPCUpdateKubectlClusterSettingsResponse
}
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsOK) Error() string {
return fmt.Sprintf("[PUT /v2/sentry/kubectl/{opts.urlScope}/settings][%d] kubectlClusterSettingsUpdateKubectlClusterSettingsOK %+v", 200, o.Payload)
}
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsOK) GetPayload() models.RPCUpdateKubectlClusterSettingsResponse {
return o.Payload
}
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewKubectlClusterSettingsUpdateKubectlClusterSettingsForbidden creates a KubectlClusterSettingsUpdateKubectlClusterSettingsForbidden with default headers values
func NewKubectlClusterSettingsUpdateKubectlClusterSettingsForbidden() *KubectlClusterSettingsUpdateKubectlClusterSettingsForbidden {
return &KubectlClusterSettingsUpdateKubectlClusterSettingsForbidden{}
}
/* KubectlClusterSettingsUpdateKubectlClusterSettingsForbidden describes a response with status code 403, with default header values.
Returned when the user does not have permission to access the resource.
*/
type KubectlClusterSettingsUpdateKubectlClusterSettingsForbidden struct {
Payload interface{}
}
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsForbidden) Error() string {
return fmt.Sprintf("[PUT /v2/sentry/kubectl/{opts.urlScope}/settings][%d] kubectlClusterSettingsUpdateKubectlClusterSettingsForbidden %+v", 403, o.Payload)
}
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsForbidden) GetPayload() interface{} {
return o.Payload
}
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewKubectlClusterSettingsUpdateKubectlClusterSettingsNotFound creates a KubectlClusterSettingsUpdateKubectlClusterSettingsNotFound with default headers values
func NewKubectlClusterSettingsUpdateKubectlClusterSettingsNotFound() *KubectlClusterSettingsUpdateKubectlClusterSettingsNotFound {
return &KubectlClusterSettingsUpdateKubectlClusterSettingsNotFound{}
}
/* KubectlClusterSettingsUpdateKubectlClusterSettingsNotFound describes a response with status code 404, with default header values.
Returned when the resource does not exist.
*/
type KubectlClusterSettingsUpdateKubectlClusterSettingsNotFound struct {
Payload string
}
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsNotFound) Error() string {
return fmt.Sprintf("[PUT /v2/sentry/kubectl/{opts.urlScope}/settings][%d] kubectlClusterSettingsUpdateKubectlClusterSettingsNotFound %+v", 404, o.Payload)
}
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsNotFound) GetPayload() string {
return o.Payload
}
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewKubectlClusterSettingsUpdateKubectlClusterSettingsDefault creates a KubectlClusterSettingsUpdateKubectlClusterSettingsDefault with default headers values
func NewKubectlClusterSettingsUpdateKubectlClusterSettingsDefault(code int) *KubectlClusterSettingsUpdateKubectlClusterSettingsDefault {
return &KubectlClusterSettingsUpdateKubectlClusterSettingsDefault{
_statusCode: code,
}
}
/* KubectlClusterSettingsUpdateKubectlClusterSettingsDefault describes a response with status code -1, with default header values.
An unexpected error response.
*/
type KubectlClusterSettingsUpdateKubectlClusterSettingsDefault struct {
_statusCode int
Payload *models.GooglerpcStatus
}
// Code gets the status code for the kubectl cluster settings update kubectl cluster settings default response
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsDefault) Code() int {
return o._statusCode
}
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsDefault) Error() string {
return fmt.Sprintf("[PUT /v2/sentry/kubectl/{opts.urlScope}/settings][%d] KubectlClusterSettings_UpdateKubectlClusterSettings default %+v", o._statusCode, o.Payload)
}
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsDefault) GetPayload() *models.GooglerpcStatus {
return o.Payload
}
func (o *KubectlClusterSettingsUpdateKubectlClusterSettingsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.GooglerpcStatus)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@@ -0,0 +1,112 @@
// Code generated by go-swagger; DO NOT EDIT.
package client
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"github.com/RafaySystems/rcloud-base/api/def/clients/sentry/client/bootstrap"
)
// Default sentry bootstrap service HTTP client.
var Default = NewHTTPClient(nil)
const (
// DefaultHost is the default Host
// found in Meta (info) section of spec file
DefaultHost string = "localhost"
// DefaultBasePath is the default BasePath
// found in Meta (info) section of spec file
DefaultBasePath string = "/"
)
// DefaultSchemes are the default schemes found in Meta (info) section of spec file
var DefaultSchemes = []string{"https"}
// NewHTTPClient creates a new sentry bootstrap service HTTP client.
func NewHTTPClient(formats strfmt.Registry) *SentryBootstrapService {
return NewHTTPClientWithConfig(formats, nil)
}
// NewHTTPClientWithConfig creates a new sentry bootstrap service HTTP client,
// using a customizable transport config.
func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *SentryBootstrapService {
// ensure nullable parameters have default
if cfg == nil {
cfg = DefaultTransportConfig()
}
// create transport and client
transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes)
return New(transport, formats)
}
// New creates a new sentry bootstrap service client
func New(transport runtime.ClientTransport, formats strfmt.Registry) *SentryBootstrapService {
// ensure nullable parameters have default
if formats == nil {
formats = strfmt.Default
}
cli := new(SentryBootstrapService)
cli.Transport = transport
cli.Bootstrap = bootstrap.New(transport, formats)
return cli
}
// DefaultTransportConfig creates a TransportConfig with the
// default settings taken from the meta section of the spec file.
func DefaultTransportConfig() *TransportConfig {
return &TransportConfig{
Host: DefaultHost,
BasePath: DefaultBasePath,
Schemes: DefaultSchemes,
}
}
// TransportConfig contains the transport related info,
// found in the meta section of the spec file.
type TransportConfig struct {
Host string
BasePath string
Schemes []string
}
// WithHost overrides the default host,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithHost(host string) *TransportConfig {
cfg.Host = host
return cfg
}
// WithBasePath overrides the default basePath,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig {
cfg.BasePath = basePath
return cfg
}
// WithSchemes overrides the default schemes,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig {
cfg.Schemes = schemes
return cfg
}
// SentryBootstrapService is a client for sentry bootstrap service
type SentryBootstrapService struct {
Bootstrap bootstrap.ClientService
Transport runtime.ClientTransport
}
// SetTransport changes the transport on the client and all its subresources
func (c *SentryBootstrapService) SetTransport(transport runtime.ClientTransport) {
c.Transport = transport
c.Bootstrap.SetTransport(transport)
}

View File

@@ -0,0 +1,158 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// ControllerStepObject +kubebuilder:object:generate=true
// StepObject can represent any kubernetes object
//
// swagger:model controllerStepObject
type ControllerStepObject struct {
// name
Name string `json:"name,omitempty"`
// object meta
ObjectMeta *V1ObjectMeta `json:"objectMeta,omitempty"`
// raw
// Format: byte
Raw strfmt.Base64 `json:"raw,omitempty"`
// type meta
TypeMeta *Metav1TypeMeta `json:"typeMeta,omitempty"`
}
// Validate validates this controller step object
func (m *ControllerStepObject) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateObjectMeta(formats); err != nil {
res = append(res, err)
}
if err := m.validateTypeMeta(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *ControllerStepObject) validateObjectMeta(formats strfmt.Registry) error {
if swag.IsZero(m.ObjectMeta) { // not required
return nil
}
if m.ObjectMeta != nil {
if err := m.ObjectMeta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("objectMeta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("objectMeta")
}
return err
}
}
return nil
}
func (m *ControllerStepObject) validateTypeMeta(formats strfmt.Registry) error {
if swag.IsZero(m.TypeMeta) { // not required
return nil
}
if m.TypeMeta != nil {
if err := m.TypeMeta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("typeMeta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("typeMeta")
}
return err
}
}
return nil
}
// ContextValidate validate this controller step object based on the context it is used
func (m *ControllerStepObject) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateObjectMeta(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateTypeMeta(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *ControllerStepObject) contextValidateObjectMeta(ctx context.Context, formats strfmt.Registry) error {
if m.ObjectMeta != nil {
if err := m.ObjectMeta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("objectMeta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("objectMeta")
}
return err
}
}
return nil
}
func (m *ControllerStepObject) contextValidateTypeMeta(ctx context.Context, formats strfmt.Registry) error {
if m.TypeMeta != nil {
if err := m.TypeMeta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("typeMeta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("typeMeta")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *ControllerStepObject) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ControllerStepObject) UnmarshalBinary(b []byte) error {
var res ControllerStepObject
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,122 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// GooglerpcStatus googlerpc status
//
// swagger:model googlerpcStatus
type GooglerpcStatus struct {
// code
Code int32 `json:"code,omitempty"`
// details
Details []*ProtobufAny `json:"details"`
// message
Message string `json:"message,omitempty"`
}
// Validate validates this googlerpc status
func (m *GooglerpcStatus) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateDetails(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GooglerpcStatus) validateDetails(formats strfmt.Registry) error {
if swag.IsZero(m.Details) { // not required
return nil
}
for i := 0; i < len(m.Details); i++ {
if swag.IsZero(m.Details[i]) { // not required
continue
}
if m.Details[i] != nil {
if err := m.Details[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("details" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("details" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this googlerpc status based on the context it is used
func (m *GooglerpcStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateDetails(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GooglerpcStatus) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Details); i++ {
if m.Details[i] != nil {
if err := m.Details[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("details" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("details" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *GooglerpcStatus) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *GooglerpcStatus) UnmarshalBinary(b []byte) error {
var res GooglerpcStatus
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,66 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/strfmt"
"github.com/go-openapi/swag"
)
// Metav1TypeMeta TypeMeta describes an individual object in an API response or request
// with strings representing the type of the object and its API schema version.
// Structures that are versioned or persisted should inline TypeMeta.
//
// +k8s:deepcopy-gen=false
//
// swagger:model metav1TypeMeta
type Metav1TypeMeta struct {
// APIVersion defines the versioned schema of this representation of an object.
// Servers should convert recognized schemas to the latest internal value, and
// may reject unrecognized values.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
// +optional
APIVersion string `json:"apiVersion,omitempty"`
// Kind is a string value representing the REST resource this object represents.
// Servers may infer this from the endpoint the client submits requests to.
// Cannot be updated.
// In CamelCase.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
Kind string `json:"kind,omitempty"`
}
// Validate validates this metav1 type meta
func (m *Metav1TypeMeta) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this metav1 type meta based on context it is used
func (m *Metav1TypeMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Metav1TypeMeta) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Metav1TypeMeta) UnmarshalBinary(b []byte) error {
var res Metav1TypeMeta
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,50 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/strfmt"
"github.com/go-openapi/swag"
)
// ProtobufAny protobuf any
//
// swagger:model protobufAny
type ProtobufAny struct {
// at type
AtType string `json:"@type,omitempty"`
}
// Validate validates this protobuf any
func (m *ProtobufAny) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this protobuf any based on context it is used
func (m *ProtobufAny) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *ProtobufAny) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ProtobufAny) UnmarshalBinary(b []byte) error {
var res ProtobufAny
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,11 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// RPCDeleteBootstrapAgentResponse rpc delete bootstrap agent response
//
// swagger:model rpcDeleteBootstrapAgentResponse
type RPCDeleteBootstrapAgentResponse interface{}

View File

@@ -0,0 +1,53 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/strfmt"
"github.com/go-openapi/swag"
)
// RPCGetKubectlClusterSettingsResponse rpc get kubectl cluster settings response
//
// swagger:model rpcGetKubectlClusterSettingsResponse
type RPCGetKubectlClusterSettingsResponse struct {
// disable c l i kubectl
DisableCLIKubectl bool `json:"disableCLIKubectl,omitempty"`
// disable web kubectl
DisableWebKubectl bool `json:"disableWebKubectl,omitempty"`
}
// Validate validates this rpc get kubectl cluster settings response
func (m *RPCGetKubectlClusterSettingsResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this rpc get kubectl cluster settings response based on context it is used
func (m *RPCGetKubectlClusterSettingsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *RPCGetKubectlClusterSettingsResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *RPCGetKubectlClusterSettingsResponse) UnmarshalBinary(b []byte) error {
var res RPCGetKubectlClusterSettingsResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,519 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// RPCGetUserAuthorizationResponse rpc get user authorization response
//
// swagger:model rpcGetUserAuthorizationResponse
type RPCGetUserAuthorizationResponse struct {
// cluster role bindings
ClusterRoleBindings []*ControllerStepObject `json:"clusterRoleBindings"`
// cluster roles
ClusterRoles []*ControllerStepObject `json:"clusterRoles"`
// delete cluster role bindings
DeleteClusterRoleBindings []*ControllerStepObject `json:"deleteClusterRoleBindings"`
// delete role bindings
DeleteRoleBindings []*ControllerStepObject `json:"deleteRoleBindings"`
// enforce org admin only secret access
EnforceOrgAdminOnlySecretAccess bool `json:"enforceOrgAdminOnlySecretAccess,omitempty"`
// is org admin
IsOrgAdmin bool `json:"isOrgAdmin,omitempty"`
// is read
IsRead bool `json:"isRead,omitempty"`
// namespaces
Namespaces []*ControllerStepObject `json:"namespaces"`
// role bindings
RoleBindings []*ControllerStepObject `json:"roleBindings"`
// role name
RoleName string `json:"roleName,omitempty"`
// roles
Roles []*ControllerStepObject `json:"roles"`
// service account
ServiceAccount *ControllerStepObject `json:"serviceAccount,omitempty"`
// user name
UserName string `json:"userName,omitempty"`
}
// Validate validates this rpc get user authorization response
func (m *RPCGetUserAuthorizationResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateClusterRoleBindings(formats); err != nil {
res = append(res, err)
}
if err := m.validateClusterRoles(formats); err != nil {
res = append(res, err)
}
if err := m.validateDeleteClusterRoleBindings(formats); err != nil {
res = append(res, err)
}
if err := m.validateDeleteRoleBindings(formats); err != nil {
res = append(res, err)
}
if err := m.validateNamespaces(formats); err != nil {
res = append(res, err)
}
if err := m.validateRoleBindings(formats); err != nil {
res = append(res, err)
}
if err := m.validateRoles(formats); err != nil {
res = append(res, err)
}
if err := m.validateServiceAccount(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *RPCGetUserAuthorizationResponse) validateClusterRoleBindings(formats strfmt.Registry) error {
if swag.IsZero(m.ClusterRoleBindings) { // not required
return nil
}
for i := 0; i < len(m.ClusterRoleBindings); i++ {
if swag.IsZero(m.ClusterRoleBindings[i]) { // not required
continue
}
if m.ClusterRoleBindings[i] != nil {
if err := m.ClusterRoleBindings[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("clusterRoleBindings" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("clusterRoleBindings" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *RPCGetUserAuthorizationResponse) validateClusterRoles(formats strfmt.Registry) error {
if swag.IsZero(m.ClusterRoles) { // not required
return nil
}
for i := 0; i < len(m.ClusterRoles); i++ {
if swag.IsZero(m.ClusterRoles[i]) { // not required
continue
}
if m.ClusterRoles[i] != nil {
if err := m.ClusterRoles[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("clusterRoles" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("clusterRoles" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *RPCGetUserAuthorizationResponse) validateDeleteClusterRoleBindings(formats strfmt.Registry) error {
if swag.IsZero(m.DeleteClusterRoleBindings) { // not required
return nil
}
for i := 0; i < len(m.DeleteClusterRoleBindings); i++ {
if swag.IsZero(m.DeleteClusterRoleBindings[i]) { // not required
continue
}
if m.DeleteClusterRoleBindings[i] != nil {
if err := m.DeleteClusterRoleBindings[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("deleteClusterRoleBindings" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("deleteClusterRoleBindings" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *RPCGetUserAuthorizationResponse) validateDeleteRoleBindings(formats strfmt.Registry) error {
if swag.IsZero(m.DeleteRoleBindings) { // not required
return nil
}
for i := 0; i < len(m.DeleteRoleBindings); i++ {
if swag.IsZero(m.DeleteRoleBindings[i]) { // not required
continue
}
if m.DeleteRoleBindings[i] != nil {
if err := m.DeleteRoleBindings[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("deleteRoleBindings" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("deleteRoleBindings" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *RPCGetUserAuthorizationResponse) validateNamespaces(formats strfmt.Registry) error {
if swag.IsZero(m.Namespaces) { // not required
return nil
}
for i := 0; i < len(m.Namespaces); i++ {
if swag.IsZero(m.Namespaces[i]) { // not required
continue
}
if m.Namespaces[i] != nil {
if err := m.Namespaces[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("namespaces" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("namespaces" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *RPCGetUserAuthorizationResponse) validateRoleBindings(formats strfmt.Registry) error {
if swag.IsZero(m.RoleBindings) { // not required
return nil
}
for i := 0; i < len(m.RoleBindings); i++ {
if swag.IsZero(m.RoleBindings[i]) { // not required
continue
}
if m.RoleBindings[i] != nil {
if err := m.RoleBindings[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("roleBindings" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("roleBindings" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *RPCGetUserAuthorizationResponse) validateRoles(formats strfmt.Registry) error {
if swag.IsZero(m.Roles) { // not required
return nil
}
for i := 0; i < len(m.Roles); i++ {
if swag.IsZero(m.Roles[i]) { // not required
continue
}
if m.Roles[i] != nil {
if err := m.Roles[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("roles" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("roles" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *RPCGetUserAuthorizationResponse) validateServiceAccount(formats strfmt.Registry) error {
if swag.IsZero(m.ServiceAccount) { // not required
return nil
}
if m.ServiceAccount != nil {
if err := m.ServiceAccount.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("serviceAccount")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("serviceAccount")
}
return err
}
}
return nil
}
// ContextValidate validate this rpc get user authorization response based on the context it is used
func (m *RPCGetUserAuthorizationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateClusterRoleBindings(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateClusterRoles(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateDeleteClusterRoleBindings(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateDeleteRoleBindings(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateNamespaces(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRoleBindings(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRoles(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateServiceAccount(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *RPCGetUserAuthorizationResponse) contextValidateClusterRoleBindings(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.ClusterRoleBindings); i++ {
if m.ClusterRoleBindings[i] != nil {
if err := m.ClusterRoleBindings[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("clusterRoleBindings" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("clusterRoleBindings" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *RPCGetUserAuthorizationResponse) contextValidateClusterRoles(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.ClusterRoles); i++ {
if m.ClusterRoles[i] != nil {
if err := m.ClusterRoles[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("clusterRoles" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("clusterRoles" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *RPCGetUserAuthorizationResponse) contextValidateDeleteClusterRoleBindings(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.DeleteClusterRoleBindings); i++ {
if m.DeleteClusterRoleBindings[i] != nil {
if err := m.DeleteClusterRoleBindings[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("deleteClusterRoleBindings" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("deleteClusterRoleBindings" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *RPCGetUserAuthorizationResponse) contextValidateDeleteRoleBindings(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.DeleteRoleBindings); i++ {
if m.DeleteRoleBindings[i] != nil {
if err := m.DeleteRoleBindings[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("deleteRoleBindings" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("deleteRoleBindings" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *RPCGetUserAuthorizationResponse) contextValidateNamespaces(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Namespaces); i++ {
if m.Namespaces[i] != nil {
if err := m.Namespaces[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("namespaces" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("namespaces" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *RPCGetUserAuthorizationResponse) contextValidateRoleBindings(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.RoleBindings); i++ {
if m.RoleBindings[i] != nil {
if err := m.RoleBindings[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("roleBindings" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("roleBindings" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *RPCGetUserAuthorizationResponse) contextValidateRoles(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Roles); i++ {
if m.Roles[i] != nil {
if err := m.Roles[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("roles" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("roles" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *RPCGetUserAuthorizationResponse) contextValidateServiceAccount(ctx context.Context, formats strfmt.Registry) error {
if m.ServiceAccount != nil {
if err := m.ServiceAccount.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("serviceAccount")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("serviceAccount")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *RPCGetUserAuthorizationResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *RPCGetUserAuthorizationResponse) UnmarshalBinary(b []byte) error {
var res RPCGetUserAuthorizationResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,53 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/strfmt"
"github.com/go-openapi/swag"
)
// RPCLookupClusterResponse rpc lookup cluster response
//
// swagger:model rpcLookupClusterResponse
type RPCLookupClusterResponse struct {
// display name
DisplayName string `json:"displayName,omitempty"`
// name
Name string `json:"name,omitempty"`
}
// Validate validates this rpc lookup cluster response
func (m *RPCLookupClusterResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this rpc lookup cluster response based on context it is used
func (m *RPCLookupClusterResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *RPCLookupClusterResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *RPCLookupClusterResponse) UnmarshalBinary(b []byte) error {
var res RPCLookupClusterResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,65 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/strfmt"
"github.com/go-openapi/swag"
)
// RPCLookupUserResponse rpc lookup user response
//
// swagger:model rpcLookupUserResponse
type RPCLookupUserResponse struct {
// account ID
AccountID string `json:"accountID,omitempty"`
// is s s o
IsSSO string `json:"isSSO,omitempty"`
// organization ID
OrganizationID string `json:"organizationID,omitempty"`
// partner ID
PartnerID string `json:"partnerID,omitempty"`
// session type
SessionType string `json:"sessionType,omitempty"`
// user name
UserName string `json:"userName,omitempty"`
}
// Validate validates this rpc lookup user response
func (m *RPCLookupUserResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this rpc lookup user response based on context it is used
func (m *RPCLookupUserResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *RPCLookupUserResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *RPCLookupUserResponse) UnmarshalBinary(b []byte) error {
var res RPCLookupUserResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,55 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/strfmt"
"github.com/go-openapi/swag"
)
// RPCRegisterAgentResponse rpc register agent response
//
// swagger:model rpcRegisterAgentResponse
type RPCRegisterAgentResponse struct {
// ca certificate
// Format: byte
CaCertificate strfmt.Base64 `json:"caCertificate,omitempty"`
// certificate
// Format: byte
Certificate strfmt.Base64 `json:"certificate,omitempty"`
}
// Validate validates this rpc register agent response
func (m *RPCRegisterAgentResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this rpc register agent response based on context it is used
func (m *RPCRegisterAgentResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *RPCRegisterAgentResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *RPCRegisterAgentResponse) UnmarshalBinary(b []byte) error {
var res RPCRegisterAgentResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,110 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// RPCUpdateKubectlClusterSettingsRequest rpc update kubectl cluster settings request
//
// swagger:model rpcUpdateKubectlClusterSettingsRequest
type RPCUpdateKubectlClusterSettingsRequest struct {
// disable c l i kubectl
DisableCLIKubectl bool `json:"disableCLIKubectl,omitempty"`
// disable web kubectl
DisableWebKubectl bool `json:"disableWebKubectl,omitempty"`
// opts
Opts *V3QueryOptions `json:"opts,omitempty"`
}
// Validate validates this rpc update kubectl cluster settings request
func (m *RPCUpdateKubectlClusterSettingsRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateOpts(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *RPCUpdateKubectlClusterSettingsRequest) validateOpts(formats strfmt.Registry) error {
if swag.IsZero(m.Opts) { // not required
return nil
}
if m.Opts != nil {
if err := m.Opts.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("opts")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("opts")
}
return err
}
}
return nil
}
// ContextValidate validate this rpc update kubectl cluster settings request based on the context it is used
func (m *RPCUpdateKubectlClusterSettingsRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateOpts(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *RPCUpdateKubectlClusterSettingsRequest) contextValidateOpts(ctx context.Context, formats strfmt.Registry) error {
if m.Opts != nil {
if err := m.Opts.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("opts")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("opts")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *RPCUpdateKubectlClusterSettingsRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *RPCUpdateKubectlClusterSettingsRequest) UnmarshalBinary(b []byte) error {
var res RPCUpdateKubectlClusterSettingsRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,11 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// RPCUpdateKubectlClusterSettingsResponse rpc update kubectl cluster settings response
//
// swagger:model rpcUpdateKubectlClusterSettingsResponse
type RPCUpdateKubectlClusterSettingsResponse interface{}

View File

@@ -0,0 +1,131 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// SentryBootStrapAgentStatus sentry boot strap agent status
//
// swagger:model sentryBootStrapAgentStatus
type SentryBootStrapAgentStatus struct {
// fingerprint
Fingerprint string `json:"fingerprint,omitempty"`
// ip address
IPAddress string `json:"ipAddress,omitempty"`
// last checked in
// Format: date-time
LastCheckedIn strfmt.DateTime `json:"lastCheckedIn,omitempty"`
// token state
TokenState *SentryBootstrapAgentState `json:"tokenState,omitempty"`
}
// Validate validates this sentry boot strap agent status
func (m *SentryBootStrapAgentStatus) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateLastCheckedIn(formats); err != nil {
res = append(res, err)
}
if err := m.validateTokenState(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *SentryBootStrapAgentStatus) validateLastCheckedIn(formats strfmt.Registry) error {
if swag.IsZero(m.LastCheckedIn) { // not required
return nil
}
if err := validate.FormatOf("lastCheckedIn", "body", "date-time", m.LastCheckedIn.String(), formats); err != nil {
return err
}
return nil
}
func (m *SentryBootStrapAgentStatus) validateTokenState(formats strfmt.Registry) error {
if swag.IsZero(m.TokenState) { // not required
return nil
}
if m.TokenState != nil {
if err := m.TokenState.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tokenState")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("tokenState")
}
return err
}
}
return nil
}
// ContextValidate validate this sentry boot strap agent status based on the context it is used
func (m *SentryBootStrapAgentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateTokenState(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *SentryBootStrapAgentStatus) contextValidateTokenState(ctx context.Context, formats strfmt.Registry) error {
if m.TokenState != nil {
if err := m.TokenState.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tokenState")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("tokenState")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *SentryBootStrapAgentStatus) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *SentryBootStrapAgentStatus) UnmarshalBinary(b []byte) error {
var res SentryBootStrapAgentStatus
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,237 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// SentryBootstrapAgent sentry bootstrap agent
//
// swagger:model sentryBootstrapAgent
type SentryBootstrapAgent struct {
// API Version
//
// API Version of the resource
// Read Only: true
APIVersion string `json:"apiVersion,omitempty"`
// Kind
//
// Kind of the resource
// Read Only: true
Kind string `json:"kind,omitempty"`
// Metadata
//
// Metadata of the resource
Metadata *V3Metadata `json:"metadata,omitempty"`
// spec
Spec *SentryBootstrapAgentSpec `json:"spec,omitempty"`
// status
Status *SentryBootStrapAgentStatus `json:"status,omitempty"`
}
// Validate validates this sentry bootstrap agent
func (m *SentryBootstrapAgent) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateMetadata(formats); err != nil {
res = append(res, err)
}
if err := m.validateSpec(formats); err != nil {
res = append(res, err)
}
if err := m.validateStatus(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *SentryBootstrapAgent) validateMetadata(formats strfmt.Registry) error {
if swag.IsZero(m.Metadata) { // not required
return nil
}
if m.Metadata != nil {
if err := m.Metadata.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("metadata")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("metadata")
}
return err
}
}
return nil
}
func (m *SentryBootstrapAgent) validateSpec(formats strfmt.Registry) error {
if swag.IsZero(m.Spec) { // not required
return nil
}
if m.Spec != nil {
if err := m.Spec.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("spec")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("spec")
}
return err
}
}
return nil
}
func (m *SentryBootstrapAgent) validateStatus(formats strfmt.Registry) error {
if swag.IsZero(m.Status) { // not required
return nil
}
if m.Status != nil {
if err := m.Status.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("status")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("status")
}
return err
}
}
return nil
}
// ContextValidate validate this sentry bootstrap agent based on the context it is used
func (m *SentryBootstrapAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateAPIVersion(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateKind(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMetadata(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateSpec(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateStatus(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *SentryBootstrapAgent) contextValidateAPIVersion(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "apiVersion", "body", string(m.APIVersion)); err != nil {
return err
}
return nil
}
func (m *SentryBootstrapAgent) contextValidateKind(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "kind", "body", string(m.Kind)); err != nil {
return err
}
return nil
}
func (m *SentryBootstrapAgent) contextValidateMetadata(ctx context.Context, formats strfmt.Registry) error {
if m.Metadata != nil {
if err := m.Metadata.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("metadata")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("metadata")
}
return err
}
}
return nil
}
func (m *SentryBootstrapAgent) contextValidateSpec(ctx context.Context, formats strfmt.Registry) error {
if m.Spec != nil {
if err := m.Spec.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("spec")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("spec")
}
return err
}
}
return nil
}
func (m *SentryBootstrapAgent) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error {
if m.Status != nil {
if err := m.Status.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("status")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("status")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *SentryBootstrapAgent) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *SentryBootstrapAgent) UnmarshalBinary(b []byte) error {
var res SentryBootstrapAgent
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,204 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// SentryBootstrapAgentList BootstrapAgentList is a list of bootstrap agents
//
// swagger:model sentryBootstrapAgentList
type SentryBootstrapAgentList struct {
// API Version
//
// API Version of the list resource
// Read Only: true
APIVersion string `json:"apiVersion,omitempty"`
// items
Items []*SentryBootstrapAgent `json:"items"`
// Kind
//
// Kind of the list resource
// Read Only: true
Kind string `json:"kind,omitempty"`
// ListMetadata
//
// Metadata of the list resource
// Read Only: true
Metadata *V3ListMetadata `json:"metadata,omitempty"`
}
// Validate validates this sentry bootstrap agent list
func (m *SentryBootstrapAgentList) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateItems(formats); err != nil {
res = append(res, err)
}
if err := m.validateMetadata(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *SentryBootstrapAgentList) validateItems(formats strfmt.Registry) error {
if swag.IsZero(m.Items) { // not required
return nil
}
for i := 0; i < len(m.Items); i++ {
if swag.IsZero(m.Items[i]) { // not required
continue
}
if m.Items[i] != nil {
if err := m.Items[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("items" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("items" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *SentryBootstrapAgentList) validateMetadata(formats strfmt.Registry) error {
if swag.IsZero(m.Metadata) { // not required
return nil
}
if m.Metadata != nil {
if err := m.Metadata.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("metadata")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("metadata")
}
return err
}
}
return nil
}
// ContextValidate validate this sentry bootstrap agent list based on the context it is used
func (m *SentryBootstrapAgentList) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateAPIVersion(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateItems(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateKind(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMetadata(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *SentryBootstrapAgentList) contextValidateAPIVersion(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "apiVersion", "body", string(m.APIVersion)); err != nil {
return err
}
return nil
}
func (m *SentryBootstrapAgentList) contextValidateItems(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Items); i++ {
if m.Items[i] != nil {
if err := m.Items[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("items" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("items" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *SentryBootstrapAgentList) contextValidateKind(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "kind", "body", string(m.Kind)); err != nil {
return err
}
return nil
}
func (m *SentryBootstrapAgentList) contextValidateMetadata(ctx context.Context, formats strfmt.Registry) error {
if m.Metadata != nil {
if err := m.Metadata.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("metadata")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("metadata")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *SentryBootstrapAgentList) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *SentryBootstrapAgentList) UnmarshalBinary(b []byte) error {
var res SentryBootstrapAgentList
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,78 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
)
// SentryBootstrapAgentMode sentry bootstrap agent mode
//
// swagger:model sentryBootstrapAgentMode
type SentryBootstrapAgentMode string
func NewSentryBootstrapAgentMode(value SentryBootstrapAgentMode) *SentryBootstrapAgentMode {
return &value
}
// Pointer returns a pointer to a freshly-allocated SentryBootstrapAgentMode.
func (m SentryBootstrapAgentMode) Pointer() *SentryBootstrapAgentMode {
return &m
}
const (
// SentryBootstrapAgentModeInCluster captures enum value "InCluster"
SentryBootstrapAgentModeInCluster SentryBootstrapAgentMode = "InCluster"
// SentryBootstrapAgentModeOutOfCluster captures enum value "OutOfCluster"
SentryBootstrapAgentModeOutOfCluster SentryBootstrapAgentMode = "OutOfCluster"
)
// for schema
var sentryBootstrapAgentModeEnum []interface{}
func init() {
var res []SentryBootstrapAgentMode
if err := json.Unmarshal([]byte(`["InCluster","OutOfCluster"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
sentryBootstrapAgentModeEnum = append(sentryBootstrapAgentModeEnum, v)
}
}
func (m SentryBootstrapAgentMode) validateSentryBootstrapAgentModeEnum(path, location string, value SentryBootstrapAgentMode) error {
if err := validate.EnumCase(path, location, value, sentryBootstrapAgentModeEnum, true); err != nil {
return err
}
return nil
}
// Validate validates this sentry bootstrap agent mode
func (m SentryBootstrapAgentMode) Validate(formats strfmt.Registry) error {
var res []error
// value enum
if err := m.validateSentryBootstrapAgentModeEnum("", "body", m); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// ContextValidate validates this sentry bootstrap agent mode based on context it is used
func (m SentryBootstrapAgentMode) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}

View File

@@ -0,0 +1,110 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// SentryBootstrapAgentSpec sentry bootstrap agent spec
//
// swagger:model sentryBootstrapAgentSpec
type SentryBootstrapAgentSpec struct {
// agent mode
AgentMode *SentryBootstrapAgentMode `json:"agentMode,omitempty"`
// template ref
TemplateRef string `json:"templateRef,omitempty"`
// token
Token string `json:"token,omitempty"`
}
// Validate validates this sentry bootstrap agent spec
func (m *SentryBootstrapAgentSpec) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAgentMode(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *SentryBootstrapAgentSpec) validateAgentMode(formats strfmt.Registry) error {
if swag.IsZero(m.AgentMode) { // not required
return nil
}
if m.AgentMode != nil {
if err := m.AgentMode.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("agentMode")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("agentMode")
}
return err
}
}
return nil
}
// ContextValidate validate this sentry bootstrap agent spec based on the context it is used
func (m *SentryBootstrapAgentSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateAgentMode(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *SentryBootstrapAgentSpec) contextValidateAgentMode(ctx context.Context, formats strfmt.Registry) error {
if m.AgentMode != nil {
if err := m.AgentMode.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("agentMode")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("agentMode")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *SentryBootstrapAgentSpec) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *SentryBootstrapAgentSpec) UnmarshalBinary(b []byte) error {
var res SentryBootstrapAgentSpec
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,84 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
)
// SentryBootstrapAgentState sentry bootstrap agent state
//
// swagger:model sentryBootstrapAgentState
type SentryBootstrapAgentState string
func NewSentryBootstrapAgentState(value SentryBootstrapAgentState) *SentryBootstrapAgentState {
return &value
}
// Pointer returns a pointer to a freshly-allocated SentryBootstrapAgentState.
func (m SentryBootstrapAgentState) Pointer() *SentryBootstrapAgentState {
return &m
}
const (
// SentryBootstrapAgentStateNotSet captures enum value "NotSet"
SentryBootstrapAgentStateNotSet SentryBootstrapAgentState = "NotSet"
// SentryBootstrapAgentStateNotRegistered captures enum value "NotRegistered"
SentryBootstrapAgentStateNotRegistered SentryBootstrapAgentState = "NotRegistered"
// SentryBootstrapAgentStateNotApproved captures enum value "NotApproved"
SentryBootstrapAgentStateNotApproved SentryBootstrapAgentState = "NotApproved"
// SentryBootstrapAgentStateApproved captures enum value "Approved"
SentryBootstrapAgentStateApproved SentryBootstrapAgentState = "Approved"
)
// for schema
var sentryBootstrapAgentStateEnum []interface{}
func init() {
var res []SentryBootstrapAgentState
if err := json.Unmarshal([]byte(`["NotSet","NotRegistered","NotApproved","Approved"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
sentryBootstrapAgentStateEnum = append(sentryBootstrapAgentStateEnum, v)
}
}
func (m SentryBootstrapAgentState) validateSentryBootstrapAgentStateEnum(path, location string, value SentryBootstrapAgentState) error {
if err := validate.EnumCase(path, location, value, sentryBootstrapAgentStateEnum, true); err != nil {
return err
}
return nil
}
// Validate validates this sentry bootstrap agent state
func (m SentryBootstrapAgentState) Validate(formats strfmt.Registry) error {
var res []error
// value enum
if err := m.validateSentryBootstrapAgentStateEnum("", "body", m); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// ContextValidate validates this sentry bootstrap agent state based on context it is used
func (m SentryBootstrapAgentState) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}

View File

@@ -0,0 +1,194 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// SentryBootstrapAgentTemplate sentry bootstrap agent template
//
// swagger:model sentryBootstrapAgentTemplate
type SentryBootstrapAgentTemplate struct {
// API Version
//
// API Version of the resource
// Read Only: true
APIVersion string `json:"apiVersion,omitempty"`
// Kind
//
// Kind of the resource
// Read Only: true
Kind string `json:"kind,omitempty"`
// Metadata
//
// Metadata of the resource
Metadata *V3Metadata `json:"metadata,omitempty"`
// spec
Spec *SentryBootstrapAgentTemplateSpec `json:"spec,omitempty"`
// status
Status SentryBootstrapAgentTemplateStatus `json:"status,omitempty"`
}
// Validate validates this sentry bootstrap agent template
func (m *SentryBootstrapAgentTemplate) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateMetadata(formats); err != nil {
res = append(res, err)
}
if err := m.validateSpec(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *SentryBootstrapAgentTemplate) validateMetadata(formats strfmt.Registry) error {
if swag.IsZero(m.Metadata) { // not required
return nil
}
if m.Metadata != nil {
if err := m.Metadata.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("metadata")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("metadata")
}
return err
}
}
return nil
}
func (m *SentryBootstrapAgentTemplate) validateSpec(formats strfmt.Registry) error {
if swag.IsZero(m.Spec) { // not required
return nil
}
if m.Spec != nil {
if err := m.Spec.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("spec")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("spec")
}
return err
}
}
return nil
}
// ContextValidate validate this sentry bootstrap agent template based on the context it is used
func (m *SentryBootstrapAgentTemplate) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateAPIVersion(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateKind(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMetadata(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateSpec(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *SentryBootstrapAgentTemplate) contextValidateAPIVersion(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "apiVersion", "body", string(m.APIVersion)); err != nil {
return err
}
return nil
}
func (m *SentryBootstrapAgentTemplate) contextValidateKind(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "kind", "body", string(m.Kind)); err != nil {
return err
}
return nil
}
func (m *SentryBootstrapAgentTemplate) contextValidateMetadata(ctx context.Context, formats strfmt.Registry) error {
if m.Metadata != nil {
if err := m.Metadata.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("metadata")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("metadata")
}
return err
}
}
return nil
}
func (m *SentryBootstrapAgentTemplate) contextValidateSpec(ctx context.Context, formats strfmt.Registry) error {
if m.Spec != nil {
if err := m.Spec.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("spec")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("spec")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *SentryBootstrapAgentTemplate) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *SentryBootstrapAgentTemplate) UnmarshalBinary(b []byte) error {
var res SentryBootstrapAgentTemplate
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,204 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// SentryBootstrapAgentTemplateList sentry bootstrap agent template list
//
// swagger:model sentryBootstrapAgentTemplateList
type SentryBootstrapAgentTemplateList struct {
// API Version
//
// API Version of the list resource
// Read Only: true
APIVersion string `json:"apiVersion,omitempty"`
// items
Items []*SentryBootstrapAgentTemplate `json:"items"`
// Kind
//
// Kind of the list resource
// Read Only: true
Kind string `json:"kind,omitempty"`
// ListMetadata
//
// Metadata of the list resource
// Read Only: true
Metadata *V3ListMetadata `json:"metadata,omitempty"`
}
// Validate validates this sentry bootstrap agent template list
func (m *SentryBootstrapAgentTemplateList) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateItems(formats); err != nil {
res = append(res, err)
}
if err := m.validateMetadata(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *SentryBootstrapAgentTemplateList) validateItems(formats strfmt.Registry) error {
if swag.IsZero(m.Items) { // not required
return nil
}
for i := 0; i < len(m.Items); i++ {
if swag.IsZero(m.Items[i]) { // not required
continue
}
if m.Items[i] != nil {
if err := m.Items[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("items" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("items" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *SentryBootstrapAgentTemplateList) validateMetadata(formats strfmt.Registry) error {
if swag.IsZero(m.Metadata) { // not required
return nil
}
if m.Metadata != nil {
if err := m.Metadata.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("metadata")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("metadata")
}
return err
}
}
return nil
}
// ContextValidate validate this sentry bootstrap agent template list based on the context it is used
func (m *SentryBootstrapAgentTemplateList) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateAPIVersion(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateItems(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateKind(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMetadata(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *SentryBootstrapAgentTemplateList) contextValidateAPIVersion(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "apiVersion", "body", string(m.APIVersion)); err != nil {
return err
}
return nil
}
func (m *SentryBootstrapAgentTemplateList) contextValidateItems(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Items); i++ {
if m.Items[i] != nil {
if err := m.Items[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("items" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("items" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *SentryBootstrapAgentTemplateList) contextValidateKind(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "kind", "body", string(m.Kind)); err != nil {
return err
}
return nil
}
func (m *SentryBootstrapAgentTemplateList) contextValidateMetadata(ctx context.Context, formats strfmt.Registry) error {
if m.Metadata != nil {
if err := m.Metadata.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("metadata")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("metadata")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *SentryBootstrapAgentTemplateList) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *SentryBootstrapAgentTemplateList) UnmarshalBinary(b []byte) error {
var res SentryBootstrapAgentTemplateList
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,183 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// SentryBootstrapAgentTemplateSpec sentry bootstrap agent template spec
//
// swagger:model sentryBootstrapAgentTemplateSpec
type SentryBootstrapAgentTemplateSpec struct {
// auto approve
AutoApprove bool `json:"autoApprove,omitempty"`
// auto register
AutoRegister bool `json:"autoRegister,omitempty"`
// hosts
Hosts []*SentryBootstrapTemplateHost `json:"hosts"`
// ignore multiple register
IgnoreMultipleRegister bool `json:"ignoreMultipleRegister,omitempty"`
// in cluster template
InClusterTemplate string `json:"inClusterTemplate,omitempty"`
// infra ref
InfraRef string `json:"infraRef,omitempty"`
// out of cluster template
OutOfClusterTemplate string `json:"outOfClusterTemplate,omitempty"`
// template type
TemplateType *SentryBootstrapAgentTemplateType `json:"templateType,omitempty"`
// token
Token string `json:"token,omitempty"`
}
// Validate validates this sentry bootstrap agent template spec
func (m *SentryBootstrapAgentTemplateSpec) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateHosts(formats); err != nil {
res = append(res, err)
}
if err := m.validateTemplateType(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *SentryBootstrapAgentTemplateSpec) validateHosts(formats strfmt.Registry) error {
if swag.IsZero(m.Hosts) { // not required
return nil
}
for i := 0; i < len(m.Hosts); i++ {
if swag.IsZero(m.Hosts[i]) { // not required
continue
}
if m.Hosts[i] != nil {
if err := m.Hosts[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("hosts" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("hosts" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *SentryBootstrapAgentTemplateSpec) validateTemplateType(formats strfmt.Registry) error {
if swag.IsZero(m.TemplateType) { // not required
return nil
}
if m.TemplateType != nil {
if err := m.TemplateType.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("templateType")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("templateType")
}
return err
}
}
return nil
}
// ContextValidate validate this sentry bootstrap agent template spec based on the context it is used
func (m *SentryBootstrapAgentTemplateSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateHosts(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateTemplateType(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *SentryBootstrapAgentTemplateSpec) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Hosts); i++ {
if m.Hosts[i] != nil {
if err := m.Hosts[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("hosts" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("hosts" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *SentryBootstrapAgentTemplateSpec) contextValidateTemplateType(ctx context.Context, formats strfmt.Registry) error {
if m.TemplateType != nil {
if err := m.TemplateType.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("templateType")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("templateType")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *SentryBootstrapAgentTemplateSpec) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *SentryBootstrapAgentTemplateSpec) UnmarshalBinary(b []byte) error {
var res SentryBootstrapAgentTemplateSpec
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,11 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// SentryBootstrapAgentTemplateStatus sentry bootstrap agent template status
//
// swagger:model sentryBootstrapAgentTemplateStatus
type SentryBootstrapAgentTemplateStatus interface{}

View File

@@ -0,0 +1,84 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
)
// SentryBootstrapAgentTemplateType sentry bootstrap agent template type
//
// swagger:model sentryBootstrapAgentTemplateType
type SentryBootstrapAgentTemplateType string
func NewSentryBootstrapAgentTemplateType(value SentryBootstrapAgentTemplateType) *SentryBootstrapAgentTemplateType {
return &value
}
// Pointer returns a pointer to a freshly-allocated SentryBootstrapAgentTemplateType.
func (m SentryBootstrapAgentTemplateType) Pointer() *SentryBootstrapAgentTemplateType {
return &m
}
const (
// SentryBootstrapAgentTemplateTypeTemplateTypeNotSet captures enum value "TemplateTypeNotSet"
SentryBootstrapAgentTemplateTypeTemplateTypeNotSet SentryBootstrapAgentTemplateType = "TemplateTypeNotSet"
// SentryBootstrapAgentTemplateTypeClient captures enum value "Client"
SentryBootstrapAgentTemplateTypeClient SentryBootstrapAgentTemplateType = "Client"
// SentryBootstrapAgentTemplateTypeServer captures enum value "Server"
SentryBootstrapAgentTemplateTypeServer SentryBootstrapAgentTemplateType = "Server"
// SentryBootstrapAgentTemplateTypeMixed captures enum value "Mixed"
SentryBootstrapAgentTemplateTypeMixed SentryBootstrapAgentTemplateType = "Mixed"
)
// for schema
var sentryBootstrapAgentTemplateTypeEnum []interface{}
func init() {
var res []SentryBootstrapAgentTemplateType
if err := json.Unmarshal([]byte(`["TemplateTypeNotSet","Client","Server","Mixed"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
sentryBootstrapAgentTemplateTypeEnum = append(sentryBootstrapAgentTemplateTypeEnum, v)
}
}
func (m SentryBootstrapAgentTemplateType) validateSentryBootstrapAgentTemplateTypeEnum(path, location string, value SentryBootstrapAgentTemplateType) error {
if err := validate.EnumCase(path, location, value, sentryBootstrapAgentTemplateTypeEnum, true); err != nil {
return err
}
return nil
}
// Validate validates this sentry bootstrap agent template type
func (m SentryBootstrapAgentTemplateType) Validate(formats strfmt.Registry) error {
var res []error
// value enum
if err := m.validateSentryBootstrapAgentTemplateTypeEnum("", "body", m); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// ContextValidate validates this sentry bootstrap agent template type based on context it is used
func (m SentryBootstrapAgentTemplateType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}

View File

@@ -0,0 +1,194 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// SentryBootstrapInfra sentry bootstrap infra
//
// swagger:model sentryBootstrapInfra
type SentryBootstrapInfra struct {
// API Version
//
// API Version of the resource
// Read Only: true
APIVersion string `json:"apiVersion,omitempty"`
// Kind
//
// Kind of the resource
// Read Only: true
Kind string `json:"kind,omitempty"`
// Metadata
//
// Metadata of the resource
Metadata *V3Metadata `json:"metadata,omitempty"`
// spec
Spec *SentryBootstrapInfraSpec `json:"spec,omitempty"`
// status
Status SentryBootstrapInfraStatus `json:"status,omitempty"`
}
// Validate validates this sentry bootstrap infra
func (m *SentryBootstrapInfra) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateMetadata(formats); err != nil {
res = append(res, err)
}
if err := m.validateSpec(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *SentryBootstrapInfra) validateMetadata(formats strfmt.Registry) error {
if swag.IsZero(m.Metadata) { // not required
return nil
}
if m.Metadata != nil {
if err := m.Metadata.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("metadata")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("metadata")
}
return err
}
}
return nil
}
func (m *SentryBootstrapInfra) validateSpec(formats strfmt.Registry) error {
if swag.IsZero(m.Spec) { // not required
return nil
}
if m.Spec != nil {
if err := m.Spec.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("spec")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("spec")
}
return err
}
}
return nil
}
// ContextValidate validate this sentry bootstrap infra based on the context it is used
func (m *SentryBootstrapInfra) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateAPIVersion(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateKind(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMetadata(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateSpec(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *SentryBootstrapInfra) contextValidateAPIVersion(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "apiVersion", "body", string(m.APIVersion)); err != nil {
return err
}
return nil
}
func (m *SentryBootstrapInfra) contextValidateKind(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "kind", "body", string(m.Kind)); err != nil {
return err
}
return nil
}
func (m *SentryBootstrapInfra) contextValidateMetadata(ctx context.Context, formats strfmt.Registry) error {
if m.Metadata != nil {
if err := m.Metadata.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("metadata")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("metadata")
}
return err
}
}
return nil
}
func (m *SentryBootstrapInfra) contextValidateSpec(ctx context.Context, formats strfmt.Registry) error {
if m.Spec != nil {
if err := m.Spec.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("spec")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("spec")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *SentryBootstrapInfra) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *SentryBootstrapInfra) UnmarshalBinary(b []byte) error {
var res SentryBootstrapInfra
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,56 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/strfmt"
"github.com/go-openapi/swag"
)
// SentryBootstrapInfraSpec sentry bootstrap infra spec
//
// swagger:model sentryBootstrapInfraSpec
type SentryBootstrapInfraSpec struct {
// ca cert
CaCert string `json:"caCert,omitempty"`
// ca key
CaKey string `json:"caKey,omitempty"`
// ca key pass
CaKeyPass string `json:"caKeyPass,omitempty"`
}
// Validate validates this sentry bootstrap infra spec
func (m *SentryBootstrapInfraSpec) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this sentry bootstrap infra spec based on context it is used
func (m *SentryBootstrapInfraSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *SentryBootstrapInfraSpec) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *SentryBootstrapInfraSpec) UnmarshalBinary(b []byte) error {
var res SentryBootstrapInfraSpec
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,11 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// SentryBootstrapInfraStatus sentry bootstrap infra status
//
// swagger:model sentryBootstrapInfraStatus
type SentryBootstrapInfraStatus interface{}

View File

@@ -0,0 +1,107 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// SentryBootstrapTemplateHost sentry bootstrap template host
//
// swagger:model sentryBootstrapTemplateHost
type SentryBootstrapTemplateHost struct {
// host
Host string `json:"host,omitempty"`
// type
Type *SentryBootstrapTemplateHostType `json:"type,omitempty"`
}
// Validate validates this sentry bootstrap template host
func (m *SentryBootstrapTemplateHost) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateType(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *SentryBootstrapTemplateHost) validateType(formats strfmt.Registry) error {
if swag.IsZero(m.Type) { // not required
return nil
}
if m.Type != nil {
if err := m.Type.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("type")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("type")
}
return err
}
}
return nil
}
// ContextValidate validate this sentry bootstrap template host based on the context it is used
func (m *SentryBootstrapTemplateHost) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateType(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *SentryBootstrapTemplateHost) contextValidateType(ctx context.Context, formats strfmt.Registry) error {
if m.Type != nil {
if err := m.Type.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("type")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("type")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *SentryBootstrapTemplateHost) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *SentryBootstrapTemplateHost) UnmarshalBinary(b []byte) error {
var res SentryBootstrapTemplateHost
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,81 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
)
// SentryBootstrapTemplateHostType sentry bootstrap template host type
//
// swagger:model sentryBootstrapTemplateHostType
type SentryBootstrapTemplateHostType string
func NewSentryBootstrapTemplateHostType(value SentryBootstrapTemplateHostType) *SentryBootstrapTemplateHostType {
return &value
}
// Pointer returns a pointer to a freshly-allocated SentryBootstrapTemplateHostType.
func (m SentryBootstrapTemplateHostType) Pointer() *SentryBootstrapTemplateHostType {
return &m
}
const (
// SentryBootstrapTemplateHostTypeHostTypeNotSet captures enum value "HostTypeNotSet"
SentryBootstrapTemplateHostTypeHostTypeNotSet SentryBootstrapTemplateHostType = "HostTypeNotSet"
// SentryBootstrapTemplateHostTypeHostTypeInternal captures enum value "HostTypeInternal"
SentryBootstrapTemplateHostTypeHostTypeInternal SentryBootstrapTemplateHostType = "HostTypeInternal"
// SentryBootstrapTemplateHostTypeHostTypeExternal captures enum value "HostTypeExternal"
SentryBootstrapTemplateHostTypeHostTypeExternal SentryBootstrapTemplateHostType = "HostTypeExternal"
)
// for schema
var sentryBootstrapTemplateHostTypeEnum []interface{}
func init() {
var res []SentryBootstrapTemplateHostType
if err := json.Unmarshal([]byte(`["HostTypeNotSet","HostTypeInternal","HostTypeExternal"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
sentryBootstrapTemplateHostTypeEnum = append(sentryBootstrapTemplateHostTypeEnum, v)
}
}
func (m SentryBootstrapTemplateHostType) validateSentryBootstrapTemplateHostTypeEnum(path, location string, value SentryBootstrapTemplateHostType) error {
if err := validate.EnumCase(path, location, value, sentryBootstrapTemplateHostTypeEnum, true); err != nil {
return err
}
return nil
}
// Validate validates this sentry bootstrap template host type
func (m SentryBootstrapTemplateHostType) Validate(formats strfmt.Registry) error {
var res []error
// value enum
if err := m.validateSentryBootstrapTemplateHostTypeEnum("", "body", m); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// ContextValidate validates this sentry bootstrap template host type based on context it is used
func (m SentryBootstrapTemplateHostType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}

View File

@@ -0,0 +1,62 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/strfmt"
"github.com/go-openapi/swag"
)
// V1FieldsV1 FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.
//
// Each key is either a '.' representing the field itself, and will always map to an empty set,
// or a string representing a sub-field or item. The string will follow one of these four formats:
// 'f:<name>', where <name> is the name of a field in a struct, or key in a map
// 'v:<value>', where <value> is the exact json formatted value of a list item
// 'i:<index>', where <index> is position of a item in a list
// 'k:<keys>', where <keys> is a map of a list item's key fields to their unique values
// If a key maps to an empty Fields value, the field that key represents is part of the set.
//
// The exact format is defined in sigs.k8s.io/structured-merge-diff
// +protobuf.options.(gogoproto.goproto_stringer)=false
//
// swagger:model v1FieldsV1
type V1FieldsV1 struct {
// Raw is the underlying serialization of this object.
// Format: byte
Raw strfmt.Base64 `json:"Raw,omitempty"`
}
// Validate validates this v1 fields v1
func (m *V1FieldsV1) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this v1 fields v1 based on context it is used
func (m *V1FieldsV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *V1FieldsV1) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *V1FieldsV1) UnmarshalBinary(b []byte) error {
var res V1FieldsV1
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,170 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// V1ManagedFieldsEntry ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource
// that the fieldset applies to.
//
// swagger:model v1ManagedFieldsEntry
type V1ManagedFieldsEntry struct {
// APIVersion defines the version of this resource that this field set
// applies to. The format is "group/version" just like the top-level
// APIVersion field. It is necessary to track the version of a field
// set because it cannot be automatically converted.
APIVersion string `json:"apiVersion,omitempty"`
// FieldsType is the discriminator for the different fields format and version.
// There is currently only one possible value: "FieldsV1"
FieldsType string `json:"fieldsType,omitempty"`
// FieldsV1 holds the first JSON version format as described in the "FieldsV1" type.
// +optional
FieldsV1 *V1FieldsV1 `json:"fieldsV1,omitempty"`
// Manager is an identifier of the workflow managing these fields.
Manager string `json:"manager,omitempty"`
// Operation is the type of operation which lead to this ManagedFieldsEntry being created.
// The only valid values for this field are 'Apply' and 'Update'.
Operation string `json:"operation,omitempty"`
// Time is timestamp of when these fields were set. It should always be empty if Operation is 'Apply'
// +optional
Time *V1Time `json:"time,omitempty"`
}
// Validate validates this v1 managed fields entry
func (m *V1ManagedFieldsEntry) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateFieldsV1(formats); err != nil {
res = append(res, err)
}
if err := m.validateTime(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *V1ManagedFieldsEntry) validateFieldsV1(formats strfmt.Registry) error {
if swag.IsZero(m.FieldsV1) { // not required
return nil
}
if m.FieldsV1 != nil {
if err := m.FieldsV1.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("fieldsV1")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("fieldsV1")
}
return err
}
}
return nil
}
func (m *V1ManagedFieldsEntry) validateTime(formats strfmt.Registry) error {
if swag.IsZero(m.Time) { // not required
return nil
}
if m.Time != nil {
if err := m.Time.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("time")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("time")
}
return err
}
}
return nil
}
// ContextValidate validate this v1 managed fields entry based on the context it is used
func (m *V1ManagedFieldsEntry) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateFieldsV1(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateTime(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *V1ManagedFieldsEntry) contextValidateFieldsV1(ctx context.Context, formats strfmt.Registry) error {
if m.FieldsV1 != nil {
if err := m.FieldsV1.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("fieldsV1")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("fieldsV1")
}
return err
}
}
return nil
}
func (m *V1ManagedFieldsEntry) contextValidateTime(ctx context.Context, formats strfmt.Registry) error {
if m.Time != nil {
if err := m.Time.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("time")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("time")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *V1ManagedFieldsEntry) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *V1ManagedFieldsEntry) UnmarshalBinary(b []byte) error {
var res V1ManagedFieldsEntry
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,426 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// V1ObjectMeta ObjectMeta is metadata that all persisted resources must have, which includes all objects
// users must create.
//
// swagger:model v1ObjectMeta
type V1ObjectMeta struct {
// Annotations is an unstructured key value map stored with a resource that may be
// set by external tools to store and retrieve arbitrary metadata. They are not
// queryable and should be preserved when modifying objects.
// More info: http://kubernetes.io/docs/user-guide/annotations
// +optional
Annotations map[string]string `json:"annotations,omitempty"`
// The name of the cluster which the object belongs to.
// This is used to distinguish resources with same name and namespace in different clusters.
// This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.
// +optional
ClusterName string `json:"clusterName,omitempty"`
// CreationTimestamp is a timestamp representing the server time when this object was
// created. It is not guaranteed to be set in happens-before order across separate operations.
// Clients may not set this value. It is represented in RFC3339 form and is in UTC.
//
// Populated by the system.
// Read-only.
// Null for lists.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
CreationTimestamp *V1Time `json:"creationTimestamp,omitempty"`
// Number of seconds allowed for this object to gracefully terminate before
// it will be removed from the system. Only set when deletionTimestamp is also set.
// May only be shortened.
// Read-only.
// +optional
DeletionGracePeriodSeconds string `json:"deletionGracePeriodSeconds,omitempty"`
// DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This
// field is set by the server when a graceful deletion is requested by the user, and is not
// directly settable by a client. The resource is expected to be deleted (no longer visible
// from resource lists, and not reachable by name) after the time in this field, once the
// finalizers list is empty. As long as the finalizers list contains items, deletion is blocked.
// Once the deletionTimestamp is set, this value may not be unset or be set further into the
// future, although it may be shortened or the resource may be deleted prior to this time.
// For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react
// by sending a graceful termination signal to the containers in the pod. After that 30 seconds,
// the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup,
// remove the pod from the API. In the presence of network partitions, this object may still
// exist after this timestamp, until an administrator or automated process can determine the
// resource is fully terminated.
// If not set, graceful deletion of the object has not been requested.
//
// Populated by the system when a graceful deletion is requested.
// Read-only.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
DeletionTimestamp *V1Time `json:"deletionTimestamp,omitempty"`
// Must be empty before the object is deleted from the registry. Each entry
// is an identifier for the responsible component that will remove the entry
// from the list. If the deletionTimestamp of the object is non-nil, entries
// in this list can only be removed.
// Finalizers may be processed and removed in any order. Order is NOT enforced
// because it introduces significant risk of stuck finalizers.
// finalizers is a shared field, any actor with permission can reorder it.
// If the finalizer list is processed in order, then this can lead to a situation
// in which the component responsible for the first finalizer in the list is
// waiting for a signal (field value, external system, or other) produced by a
// component responsible for a finalizer later in the list, resulting in a deadlock.
// Without enforced ordering finalizers are free to order amongst themselves and
// are not vulnerable to ordering changes in the list.
// +optional
// +patchStrategy=merge
Finalizers []string `json:"finalizers"`
// GenerateName is an optional prefix, used by the server, to generate a unique
// name ONLY IF the Name field has not been provided.
// If this field is used, the name returned to the client will be different
// than the name passed. This value will also be combined with a unique suffix.
// The provided value has the same validation rules as the Name field,
// and may be truncated by the length of the suffix required to make the value
// unique on the server.
//
// If this field is specified and the generated name exists, the server will
// NOT return a 409 - instead, it will either return 201 Created or 500 with Reason
// ServerTimeout indicating a unique name could not be found in the time allotted, and the client
// should retry (optionally after the time indicated in the Retry-After header).
//
// Applied only if Name is not specified.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency
// +optional
GenerateName string `json:"generateName,omitempty"`
// A sequence number representing a specific generation of the desired state.
// Populated by the system. Read-only.
// +optional
Generation string `json:"generation,omitempty"`
// Map of string keys and values that can be used to organize and categorize
// (scope and select) objects. May match selectors of replication controllers
// and services.
// More info: http://kubernetes.io/docs/user-guide/labels
// +optional
Labels map[string]string `json:"labels,omitempty"`
// ManagedFields maps workflow-id and version to the set of fields
// that are managed by that workflow. This is mostly for internal
// housekeeping, and users typically shouldn't need to set or
// understand this field. A workflow can be the user's name, a
// controller's name, or the name of a specific apply path like
// "ci-cd". The set of fields is always in the version that the
// workflow used when modifying the object.
//
// +optional
ManagedFields []*V1ManagedFieldsEntry `json:"managedFields"`
// Name must be unique within a namespace. Is required when creating resources, although
// some resources may allow a client to request the generation of an appropriate name
// automatically. Name is primarily intended for creation idempotence and configuration
// definition.
// Cannot be updated.
// More info: http://kubernetes.io/docs/user-guide/identifiers#names
// +optional
Name string `json:"name,omitempty"`
// Namespace defines the space within which each name must be unique. An empty namespace is
// equivalent to the "default" namespace, but "default" is the canonical representation.
// Not all objects are required to be scoped to a namespace - the value of this field for
// those objects will be empty.
//
// Must be a DNS_LABEL.
// Cannot be updated.
// More info: http://kubernetes.io/docs/user-guide/namespaces
// +optional
Namespace string `json:"namespace,omitempty"`
// List of objects depended by this object. If ALL objects in the list have
// been deleted, this object will be garbage collected. If this object is managed by a controller,
// then an entry in this list will point to this controller, with the controller field set to true.
// There cannot be more than one managing controller.
// +optional
// +patchMergeKey=uid
// +patchStrategy=merge
OwnerReferences []*V1OwnerReference `json:"ownerReferences"`
// An opaque value that represents the internal version of this object that can
// be used by clients to determine when objects have changed. May be used for optimistic
// concurrency, change detection, and the watch operation on a resource or set of resources.
// Clients must treat these values as opaque and passed unmodified back to the server.
// They may only be valid for a particular resource or set of resources.
//
// Populated by the system.
// Read-only.
// Value must be treated as opaque by clients and .
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
// +optional
ResourceVersion string `json:"resourceVersion,omitempty"`
// SelfLink is a URL representing this object.
// Populated by the system.
// Read-only.
//
// DEPRECATED
// Kubernetes will stop propagating this field in 1.20 release and the field is planned
// to be removed in 1.21 release.
// +optional
SelfLink string `json:"selfLink,omitempty"`
// UID is the unique in time and space value for this object. It is typically generated by
// the server on successful creation of a resource and is not allowed to change on PUT
// operations.
//
// Populated by the system.
// Read-only.
// More info: http://kubernetes.io/docs/user-guide/identifiers#uids
// +optional
UID string `json:"uid,omitempty"`
}
// Validate validates this v1 object meta
func (m *V1ObjectMeta) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCreationTimestamp(formats); err != nil {
res = append(res, err)
}
if err := m.validateDeletionTimestamp(formats); err != nil {
res = append(res, err)
}
if err := m.validateManagedFields(formats); err != nil {
res = append(res, err)
}
if err := m.validateOwnerReferences(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *V1ObjectMeta) validateCreationTimestamp(formats strfmt.Registry) error {
if swag.IsZero(m.CreationTimestamp) { // not required
return nil
}
if m.CreationTimestamp != nil {
if err := m.CreationTimestamp.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("creationTimestamp")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("creationTimestamp")
}
return err
}
}
return nil
}
func (m *V1ObjectMeta) validateDeletionTimestamp(formats strfmt.Registry) error {
if swag.IsZero(m.DeletionTimestamp) { // not required
return nil
}
if m.DeletionTimestamp != nil {
if err := m.DeletionTimestamp.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("deletionTimestamp")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("deletionTimestamp")
}
return err
}
}
return nil
}
func (m *V1ObjectMeta) validateManagedFields(formats strfmt.Registry) error {
if swag.IsZero(m.ManagedFields) { // not required
return nil
}
for i := 0; i < len(m.ManagedFields); i++ {
if swag.IsZero(m.ManagedFields[i]) { // not required
continue
}
if m.ManagedFields[i] != nil {
if err := m.ManagedFields[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("managedFields" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("managedFields" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *V1ObjectMeta) validateOwnerReferences(formats strfmt.Registry) error {
if swag.IsZero(m.OwnerReferences) { // not required
return nil
}
for i := 0; i < len(m.OwnerReferences); i++ {
if swag.IsZero(m.OwnerReferences[i]) { // not required
continue
}
if m.OwnerReferences[i] != nil {
if err := m.OwnerReferences[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ownerReferences" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ownerReferences" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this v1 object meta based on the context it is used
func (m *V1ObjectMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateCreationTimestamp(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateDeletionTimestamp(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateManagedFields(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateOwnerReferences(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *V1ObjectMeta) contextValidateCreationTimestamp(ctx context.Context, formats strfmt.Registry) error {
if m.CreationTimestamp != nil {
if err := m.CreationTimestamp.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("creationTimestamp")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("creationTimestamp")
}
return err
}
}
return nil
}
func (m *V1ObjectMeta) contextValidateDeletionTimestamp(ctx context.Context, formats strfmt.Registry) error {
if m.DeletionTimestamp != nil {
if err := m.DeletionTimestamp.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("deletionTimestamp")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("deletionTimestamp")
}
return err
}
}
return nil
}
func (m *V1ObjectMeta) contextValidateManagedFields(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.ManagedFields); i++ {
if m.ManagedFields[i] != nil {
if err := m.ManagedFields[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("managedFields" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("managedFields" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *V1ObjectMeta) contextValidateOwnerReferences(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.OwnerReferences); i++ {
if m.OwnerReferences[i] != nil {
if err := m.OwnerReferences[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ownerReferences" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ownerReferences" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *V1ObjectMeta) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *V1ObjectMeta) UnmarshalBinary(b []byte) error {
var res V1ObjectMeta
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,77 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/strfmt"
"github.com/go-openapi/swag"
)
// V1OwnerReference OwnerReference contains enough information to let you identify an owning
// object. An owning object must be in the same namespace as the dependent, or
// be cluster-scoped, so there is no namespace field.
//
// swagger:model v1OwnerReference
type V1OwnerReference struct {
// API version of the referent.
APIVersion string `json:"apiVersion,omitempty"`
// If true, AND if the owner has the "foregroundDeletion" finalizer, then
// the owner cannot be deleted from the key-value store until this
// reference is removed.
// Defaults to false.
// To set this field, a user needs "delete" permission of the owner,
// otherwise 422 (Unprocessable Entity) will be returned.
// +optional
BlockOwnerDeletion bool `json:"blockOwnerDeletion,omitempty"`
// If true, this reference points to the managing controller.
// +optional
Controller bool `json:"controller,omitempty"`
// Kind of the referent.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Kind string `json:"kind,omitempty"`
// Name of the referent.
// More info: http://kubernetes.io/docs/user-guide/identifiers#names
Name string `json:"name,omitempty"`
// UID of the referent.
// More info: http://kubernetes.io/docs/user-guide/identifiers#uids
UID string `json:"uid,omitempty"`
}
// Validate validates this v1 owner reference
func (m *V1OwnerReference) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this v1 owner reference based on context it is used
func (m *V1OwnerReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *V1OwnerReference) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *V1OwnerReference) UnmarshalBinary(b []byte) error {
var res V1OwnerReference
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,64 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/strfmt"
"github.com/go-openapi/swag"
)
// V1Time Time is a wrapper around time.Time which supports correct
// marshaling to YAML and JSON. Wrappers are provided for many
// of the factory methods that the time package offers.
//
// +protobuf.options.marshal=false
// +protobuf.as=Timestamp
// +protobuf.options.(gogoproto.goproto_stringer)=false
//
// swagger:model v1Time
type V1Time struct {
// Non-negative fractions of a second at nanosecond resolution. Negative
// second values with fractions must still have non-negative nanos values
// that count forward in time. Must be from 0 to 999,999,999
// inclusive. This field may be limited in precision depending on context.
Nanos int32 `json:"nanos,omitempty"`
// Represents seconds of UTC time since Unix epoch
// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
// 9999-12-31T23:59:59Z inclusive.
Seconds string `json:"seconds,omitempty"`
}
// Validate validates this v1 time
func (m *V1Time) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this v1 time based on context it is used
func (m *V1Time) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *V1Time) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *V1Time) UnmarshalBinary(b []byte) error {
var res V1Time
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,55 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/strfmt"
"github.com/go-openapi/swag"
)
// V3HTTPBody HttpBody represents arbitrary HTTP Body. It should only be used for
// payload formats that can't be represented as JSON
//
// swagger:model v3HttpBody
type V3HTTPBody struct {
// The HTTP Content-Type header value specifying the content type of the body.
ContentType string `json:"contentType,omitempty"`
// The HTTP request/response body as raw binary.
// Format: byte
Data strfmt.Base64 `json:"data,omitempty"`
}
// Validate validates this v3 Http body
func (m *V3HTTPBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this v3 Http body based on context it is used
func (m *V3HTTPBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *V3HTTPBody) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *V3HTTPBody) UnmarshalBinary(b []byte) error {
var res V3HTTPBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,58 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/strfmt"
"github.com/go-openapi/swag"
)
// V3ListMetadata $title: ListMetadata
// $description: metadata for a list of resources
// $required: enabled
//
// swagger:model v3ListMetadata
type V3ListMetadata struct {
// count
Count string `json:"count,omitempty"`
// limit
Limit string `json:"limit,omitempty"`
// offset
Offset string `json:"offset,omitempty"`
}
// Validate validates this v3 list metadata
func (m *V3ListMetadata) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this v3 list metadata based on context it is used
func (m *V3ListMetadata) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *V3ListMetadata) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *V3ListMetadata) UnmarshalBinary(b []byte) error {
var res V3ListMetadata
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,181 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// V3Metadata Metadata
//
// metadata of the resource
// Example: {"name":"some-name","project":"defaultproject"}
//
// swagger:model v3Metadata
type V3Metadata struct {
// Annotations
//
// annotations of the resource
Annotations map[string]string `json:"annotations,omitempty"`
// Description
//
// description of the resource
Description string `json:"description,omitempty"`
// Display Name
//
// display name of the resource
DisplayName string `json:"displayName,omitempty"`
// id
// Read Only: true
ID string `json:"id,omitempty"`
// Lables
//
// labels of the resource
Labels map[string]string `json:"labels,omitempty"`
// modified at
// Read Only: true
// Format: date-time
ModifiedAt strfmt.DateTime `json:"modifiedAt,omitempty"`
// Name
//
// name of the resource
// Required: true
Name *string `json:"name"`
// Organization
//
// Organization to which the resource belongs
Organization string `json:"organization,omitempty"`
// Partner
//
// Partner to which the resource belongs
Partner string `json:"partner,omitempty"`
// Project
//
// Project of the resource
// Required: true
Project *string `json:"project"`
}
// Validate validates this v3 metadata
func (m *V3Metadata) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateModifiedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateName(formats); err != nil {
res = append(res, err)
}
if err := m.validateProject(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *V3Metadata) validateModifiedAt(formats strfmt.Registry) error {
if swag.IsZero(m.ModifiedAt) { // not required
return nil
}
if err := validate.FormatOf("modifiedAt", "body", "date-time", m.ModifiedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *V3Metadata) validateName(formats strfmt.Registry) error {
if err := validate.Required("name", "body", m.Name); err != nil {
return err
}
return nil
}
func (m *V3Metadata) validateProject(formats strfmt.Registry) error {
if err := validate.Required("project", "body", m.Project); err != nil {
return err
}
return nil
}
// ContextValidate validate this v3 metadata based on the context it is used
func (m *V3Metadata) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateID(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateModifiedAt(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *V3Metadata) contextValidateID(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "id", "body", string(m.ID)); err != nil {
return err
}
return nil
}
func (m *V3Metadata) contextValidateModifiedAt(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "modifiedAt", "body", strfmt.DateTime(m.ModifiedAt)); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *V3Metadata) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *V3Metadata) UnmarshalBinary(b []byte) error {
var res V3Metadata
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,127 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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/strfmt"
"github.com/go-openapi/swag"
)
// V3QueryOptions QueryOptions is the options for performing queries on resources
//
// swagger:model v3QueryOptions
type V3QueryOptions struct {
// ID
ID string `json:"ID,omitempty"`
// account
Account string `json:"account,omitempty"`
// annotations only used for update queries to set annotations (READONLY)
Annotations map[string]string `json:"annotations,omitempty"`
// blueprint ref
BlueprintRef string `json:"blueprintRef,omitempty"`
// cluster ID
ClusterID string `json:"clusterID,omitempty"`
// count
Count string `json:"count,omitempty"`
// deleted
Deleted bool `json:"deleted,omitempty"`
// displayName only used for update queries to set displayName (READONLY)
DisplayName string `json:"displayName,omitempty"`
// extended
Extended bool `json:"extended,omitempty"`
// globalScope sets partnerID,organizationID,projectID = 0
GlobalScope bool `json:"globalScope,omitempty"`
// groups
Groups []string `json:"groups"`
// ignoreScopeDefault ignores default values for partnerID, organizationID and
// projectID
IgnoreScopeDefault bool `json:"ignoreScopeDefault,omitempty"`
// is s s o user
IsSSOUser bool `json:"isSSOUser,omitempty"`
// labels only used for update queries to set labels (READONLY)
Labels map[string]string `json:"labels,omitempty"`
// limit
Limit string `json:"limit,omitempty"`
// name is unique ID of a resource along with (partnerID, organizationID,
// projectID)
Name string `json:"name,omitempty"`
// offset
Offset string `json:"offset,omitempty"`
// order
Order string `json:"order,omitempty"`
// order by
OrderBy string `json:"orderBy,omitempty"`
// organization
Organization string `json:"organization,omitempty"`
// partner
Partner string `json:"partner,omitempty"`
// project
Project string `json:"project,omitempty"`
// published version
PublishedVersion string `json:"publishedVersion,omitempty"`
// selector is used to filter the labels of a resource
Selector string `json:"selector,omitempty"`
// urlScope is supposed to be passed in the URL as kind/HashID(value)
URLScope string `json:"urlScope,omitempty"`
// username
Username string `json:"username,omitempty"`
}
// Validate validates this v3 query options
func (m *V3QueryOptions) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this v3 query options based on context it is used
func (m *V3QueryOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *V3QueryOptions) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *V3QueryOptions) UnmarshalBinary(b []byte) error {
var res V3QueryOptions
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}