Files
zeekay 56f560f991
build / build (push) Failing after 0s
rename: ziti → zt across all paths
- Repo names: ziti-* → zt-*
- Go modules: github.com/hanzozt/ziti → github.com/hanzozt/zt
- Docker images: hanzozt/ziti-* → hanzozt/zt-*
- C/Java/JS symbols: ziti_* → zt_*
- File and directory names updated
2026-02-18 18:34:06 -08:00

228 lines
6.9 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
//
// Copyright NetFoundry Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// __ __ _
// \ \ / / (_)
// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _
// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` |
// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it.
// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, |
// __/ |
// |___/
package enroll
// 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/hanzozt/edge-api/rest_model"
)
// NewEnrollTokenParams creates a new EnrollTokenParams 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 NewEnrollTokenParams() *EnrollTokenParams {
return &EnrollTokenParams{
timeout: cr.DefaultTimeout,
}
}
// NewEnrollTokenParamsWithTimeout creates a new EnrollTokenParams object
// with the ability to set a timeout on a request.
func NewEnrollTokenParamsWithTimeout(timeout time.Duration) *EnrollTokenParams {
return &EnrollTokenParams{
timeout: timeout,
}
}
// NewEnrollTokenParamsWithContext creates a new EnrollTokenParams object
// with the ability to set a context for a request.
func NewEnrollTokenParamsWithContext(ctx context.Context) *EnrollTokenParams {
return &EnrollTokenParams{
Context: ctx,
}
}
// NewEnrollTokenParamsWithHTTPClient creates a new EnrollTokenParams object
// with the ability to set a custom HTTPClient for a request.
func NewEnrollTokenParamsWithHTTPClient(client *http.Client) *EnrollTokenParams {
return &EnrollTokenParams{
HTTPClient: client,
}
}
/*
EnrollTokenParams contains all the parameters to send to the API endpoint
for the enroll token operation.
Typically these are written to a http.Request.
*/
type EnrollTokenParams struct {
/* Authorization.
An identifying token to enroll with
*/
Authorization string
/* TokenEnrollmentRequest.
A enrollment request with or without a CSR. Including a CSR indicated an attempt to enroll with certificate
credentials. If no CSR is included, the request is assumed to be a token enrollment request that will
authenticate via tokens.
*/
TokenEnrollmentRequest *rest_model.TokenEnrollmentRequest
/* ZitiTokenIssuerID.
The id of the token issuer to use for enrollment, optional as long the the token is not opaque
*/
ZitiTokenIssuerID *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the enroll token params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *EnrollTokenParams) WithDefaults() *EnrollTokenParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the enroll token params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *EnrollTokenParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the enroll token params
func (o *EnrollTokenParams) WithTimeout(timeout time.Duration) *EnrollTokenParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the enroll token params
func (o *EnrollTokenParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the enroll token params
func (o *EnrollTokenParams) WithContext(ctx context.Context) *EnrollTokenParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the enroll token params
func (o *EnrollTokenParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the enroll token params
func (o *EnrollTokenParams) WithHTTPClient(client *http.Client) *EnrollTokenParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the enroll token params
func (o *EnrollTokenParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAuthorization adds the authorization to the enroll token params
func (o *EnrollTokenParams) WithAuthorization(authorization string) *EnrollTokenParams {
o.SetAuthorization(authorization)
return o
}
// SetAuthorization adds the authorization to the enroll token params
func (o *EnrollTokenParams) SetAuthorization(authorization string) {
o.Authorization = authorization
}
// WithTokenEnrollmentRequest adds the tokenEnrollmentRequest to the enroll token params
func (o *EnrollTokenParams) WithTokenEnrollmentRequest(tokenEnrollmentRequest *rest_model.TokenEnrollmentRequest) *EnrollTokenParams {
o.SetTokenEnrollmentRequest(tokenEnrollmentRequest)
return o
}
// SetTokenEnrollmentRequest adds the tokenEnrollmentRequest to the enroll token params
func (o *EnrollTokenParams) SetTokenEnrollmentRequest(tokenEnrollmentRequest *rest_model.TokenEnrollmentRequest) {
o.TokenEnrollmentRequest = tokenEnrollmentRequest
}
// WithZitiTokenIssuerID adds the ztTokenIssuerID to the enroll token params
func (o *EnrollTokenParams) WithZitiTokenIssuerID(ztTokenIssuerID *string) *EnrollTokenParams {
o.SetZitiTokenIssuerID(ztTokenIssuerID)
return o
}
// SetZitiTokenIssuerID adds the ztTokenIssuerId to the enroll token params
func (o *EnrollTokenParams) SetZitiTokenIssuerID(ztTokenIssuerID *string) {
o.ZitiTokenIssuerID = ztTokenIssuerID
}
// WriteToRequest writes these params to a swagger request
func (o *EnrollTokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// header param Authorization
if err := r.SetHeaderParam("Authorization", o.Authorization); err != nil {
return err
}
if o.TokenEnrollmentRequest != nil {
if err := r.SetBodyParam(o.TokenEnrollmentRequest); err != nil {
return err
}
}
if o.ZitiTokenIssuerID != nil {
// header param zt-token-issuer-id
if err := r.SetHeaderParam("zt-token-issuer-id", *o.ZitiTokenIssuerID); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}